MCPcopy
hub / github.com/rclone/rclone / createOnFirstUse

Function createOnFirstUse

fs/cache/cache.go:25–37  ·  view source on GitHub ↗

Create the cache just once

()

Source from the content-addressed store, hash-verified

23
24// Create the cache just once
25func createOnFirstUse() {
26 once.Do(func() {
27 ci := fs.GetConfig(context.Background())
28 c = cache.New()
29 c.SetExpireDuration(time.Duration(ci.FsCacheExpireDuration))
30 c.SetExpireInterval(time.Duration(ci.FsCacheExpireInterval))
31 c.SetFinalizer(func(value any) {
32 if s, ok := value.(fs.Shutdowner); ok {
33 _ = fs.CountError(context.Background(), s.Shutdown(context.Background()))
34 }
35 })
36 })
37}
38
39// Canonicalize looks up fsString in the mapping from user supplied
40// names to canonical names and return the canonical form

Callers 9

CanonicalizeFunction · 0.85
GetFnFunction · 0.85
PinFunction · 0.85
UnpinFunction · 0.85
PutErrFunction · 0.85
ClearConfigFunction · 0.85
ClearFunction · 0.85
EntriesFunction · 0.85
EntriesWithPinCountFunction · 0.85

Calls 7

GetConfigFunction · 0.92
NewFunction · 0.92
SetExpireDurationMethod · 0.80
SetExpireIntervalMethod · 0.80
SetFinalizerMethod · 0.80
DoMethod · 0.65
ShutdownMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…