mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
Fix a deadlock in trove when evicting objects when we reach the maxSize used
This commit is contained in:
parent
d78832fb39
commit
21916dc0a1
@ -127,11 +127,11 @@ func (r *Cache) Set(key string, value []byte) bool {
|
||||
return false
|
||||
}
|
||||
// remove random key if only we reach the maxSize threshold
|
||||
for key := range r.items {
|
||||
for (r.currentSize + valueLen) > r.maxSize {
|
||||
for (r.currentSize + valueLen) > r.maxSize {
|
||||
for key := range r.items {
|
||||
r.doDelete(key)
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
r.items[key] = value
|
||||
|
Loading…
Reference in New Issue
Block a user