Clean up monitor on delete bucket (#10698)

master
Ritesh H Shukla 4 years ago committed by GitHub
parent bd2131ba34
commit 0b53e30ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      cmd/bucket-metadata-sys.go
  2. 7
      pkg/bucket/bandwidth/monitor.go

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

@ -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)
}

Loading…
Cancel
Save