MCPcopy
hub / github.com/rclone/rclone / Clear

Method Clear

lib/cache/cache.go:240–247  ·  view source on GitHub ↗

Clear removes everything from the cache

()

Source from the content-addressed store, hash-verified

238
239// Clear removes everything from the cache
240func (c *Cache) Clear() {
241 c.mu.Lock()
242 for key, entry := range c.cache {
243 c.finalize(entry.value)
244 delete(c.cache, key)
245 }
246 c.mu.Unlock()
247}
248
249// Entries returns the number of entries in the cache
250func (c *Cache) Entries() int {

Callers 6

TestClearFunction · 0.45
TestEntriesFunction · 0.45
TestGetMaybeFunction · 0.45
TestCacheFinalizeFunction · 0.45
TestRunFunction · 0.45
DrawMethod · 0.45

Calls 3

finalizeMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 5

TestClearFunction · 0.36
TestEntriesFunction · 0.36
TestGetMaybeFunction · 0.36
TestCacheFinalizeFunction · 0.36
TestRunFunction · 0.36