fix: DeleteBucketThrottle must delete ARN (#17034)

This commit is contained in:
jiuker 2023-04-15 17:14:26 +08:00 committed by GitHub
parent 6c1410f7f5
commit e96c88e914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,10 +186,14 @@ func (m *Monitor) DeleteBucket(bucket string) {
// DeleteBucketThrottle deletes monitoring for a bucket's target
func (m *Monitor) DeleteBucketThrottle(bucket, arn string) {
m.tlock.Lock()
delete(m.bucketThrottle, bucket)
if _, ok := m.bucketThrottle[bucket]; ok {
delete(m.bucketThrottle[bucket], arn)
}
m.tlock.Unlock()
m.mlock.Lock()
delete(m.activeBuckets, bucket)
if _, ok := m.activeBuckets[bucket]; ok {
delete(m.activeBuckets[bucket], arn)
}
m.mlock.Unlock()
}