mirror of https://github.com/minio/minio.git
Merge pull request #568 from harshavardhana/pr_out_fix_a_potential_race_between_expireobjects_and_set_over_items_map
This commit is contained in:
commit
9d484719ae
|
@ -89,13 +89,14 @@ func (r *Intelligent) ExpireObjects(gcInterval time.Duration) {
|
|||
r.gcInterval = gcInterval
|
||||
go func() {
|
||||
for range time.Tick(gcInterval) {
|
||||
for key := range r.items {
|
||||
r.Lock()
|
||||
for key := range r.items {
|
||||
|
||||
if !r.isValid(key) {
|
||||
r.Delete(key)
|
||||
}
|
||||
r.Unlock()
|
||||
}
|
||||
r.Unlock()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue