Clean up monitor on delete bucket (#10698)

This commit is contained in:
Ritesh H Shukla 2020-10-16 17:59:31 -07:00 committed by GitHub
parent bd2131ba34
commit 0b53e30ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,7 @@ func (sys *BucketMetadataSys) Remove(bucket string) {
}
sys.Lock()
delete(sys.metadataMap, bucket)
globalBucketMonitor.DeleteBucket(bucket)
sys.Unlock()
}

View File

@ -170,3 +170,10 @@ func (m *Monitor) track(bucket string, object string, timeNow time.Time) *bucket
b := m.getBucketMeasurement(bucket, timeNow)
return b
}
func (m *Monitor) DeleteBucket(bucket string) {
m.lock.Lock()
defer m.lock.Unlock()
delete(m.activeBuckets, bucket)
delete(m.bucketThrottle, bucket)
}