Create the cache just once
()
| 23 | |
| 24 | // Create the cache just once |
| 25 | func 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 |
no test coverage detected
searching dependent graphs…