vfs: Add a missed update of used cache space
The missed update can cause incorrect before-cleaning cache stats and a pre-mature condition broadcast in purgeOld before the cache space use is reduced below the quota.
This commit is contained in:
parent
2295123cad
commit
c5c56cda02
1 changed files with 1 additions and 0 deletions
|
@ -610,6 +610,7 @@ func (c *Cache) clean(removeCleanFiles bool) {
|
|||
if os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
c.updateUsed()
|
||||
c.mu.Lock()
|
||||
oldItems, oldUsed := len(c.item), fs.SizeSuffix(c.used)
|
||||
c.mu.Unlock()
|
||||
|
|
Loading…
Reference in a new issue