CleanUpCache will cleanup only the cache data that is expired
(ignoreLastTs bool)
| 1779 | |
| 1780 | // CleanUpCache will cleanup only the cache data that is expired |
| 1781 | func (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 |