MCPcopy Index your code
hub / github.com/rclone/rclone / GetPersistent

Function GetPersistent

backend/cache/storage_persistent.go:42–62  ·  view source on GitHub ↗

GetPersistent returns a single instance for the specific store

(dbPath, chunkPath string, f *Features)

Source from the content-addressed store, hash-verified

40
41// GetPersistent returns a single instance for the specific store
42func GetPersistent(dbPath, chunkPath string, f *Features) (*Persistent, error) {
43 // write lock to create one
44 boltMapMx.Lock()
45 defer boltMapMx.Unlock()
46 if b, ok := boltMap[dbPath]; ok {
47 if !b.open {
48 err := b.connect()
49 if err != nil {
50 return nil, err
51 }
52 }
53 return b, nil
54 }
55
56 bb, err := newPersistent(dbPath, chunkPath, f)
57 if err != nil {
58 return nil, err
59 }
60 boltMap[dbPath] = bb
61 return boltMap[dbPath], nil
62}
63
64type chunkInfo struct {
65 Path string

Callers 2

newCacheFsMethod · 0.92
NewFsFunction · 0.85

Calls 4

newPersistentFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
connectMethod · 0.45

Tested by 1

newCacheFsMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…