fixed quota delete

This commit is contained in:
ston1th 2022-10-08 14:03:12 +02:00
commit 3f1752e961
2 changed files with 10 additions and 8 deletions

View file

@ -42,8 +42,8 @@ func (q *Quota) cleanup() {
}
q.log.Info("quota usage", "current", atomic.LoadInt64(&q.cur), "max", q.max)
defer q.mu.Unlock()
size := q.fs.mh.DeleteOldest()
atomic.AddInt64(&q.cur, -size)
free := q.fs.mh.DeleteOldest()
atomic.AddInt64(&q.cur, -free)
}
func (q *Quota) Add(n int) {