mirror of
https://github.com/minio/minio.git
synced 2024-12-26 07:05:55 -05:00
Fix a potential race between ExpireObjects() and Set() over items map
This commit is contained in:
parent
3fc9b4554f
commit
193a6606db
@ -89,13 +89,14 @@ func (r *Intelligent) ExpireObjects(gcInterval time.Duration) {
|
||||
r.gcInterval = gcInterval
|
||||
go func() {
|
||||
for range time.Tick(gcInterval) {
|
||||
r.Lock()
|
||||
for key := range r.items {
|
||||
r.Lock()
|
||||
|
||||
if !r.isValid(key) {
|
||||
r.Delete(key)
|
||||
}
|
||||
r.Unlock()
|
||||
}
|
||||
r.Unlock()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user