MCPcopy Index your code
hub / github.com/coder/coder / Acquire

Method Acquire

coderd/files/closer.go:43–59  ·  view source on GitHub ↗
(ctx context.Context, db database.Store, fileID uuid.UUID)

Source from the content-addressed store, hash-verified

41}
42
43func (c *CacheCloser) Acquire(ctx context.Context, db database.Store, fileID uuid.UUID) (*CloseFS, error) {
44 c.mu.Lock()
45 defer c.mu.Unlock()
46
47 if c.cache == nil {
48 return nil, xerrors.New("cache is closed, and cannot acquire new files")
49 }
50
51 f, err := c.cache.Acquire(ctx, db, fileID)
52 if err != nil {
53 return nil, err
54 }
55
56 c.closers = append(c.closers, f.close)
57
58 return f, nil
59}

Callers

nothing calls this directly

Calls 4

NewMethod · 0.65
AcquireMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected