MCPcopy
hub / github.com/rclone/rclone / CleanUpCache

Method CleanUpCache

backend/cache/cache.go:1781–1789  ·  view source on GitHub ↗

CleanUpCache will cleanup only the cache data that is expired

(ignoreLastTs bool)

Source from the content-addressed store, hash-verified

1779
1780// CleanUpCache will cleanup only the cache data that is expired
1781func (f *Fs) CleanUpCache(ignoreLastTs bool) {
1782 f.cleanupMu.Lock()
1783 defer f.cleanupMu.Unlock()
1784
1785 if ignoreLastTs || time.Now().After(f.lastChunkCleanup.Add(time.Duration(f.opt.ChunkCleanInterval))) {
1786 f.cache.CleanChunksBySize(int64(f.opt.ChunkTotalSize))
1787 f.lastChunkCleanup = time.Now()
1788 }
1789}
1790
1791// StopBackgroundRunners will signal all the runners to stop their work
1792// can be triggered from a terminate signal or from testing between runs

Callers 3

NewFsFunction · 0.95
CleanUpMethod · 0.95

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.65
CleanChunksBySizeMethod · 0.45

Tested by 1