diff --git a/core/circuitbreaker/rule.go b/core/circuitbreaker/rule.go index cea8897f4..4103011e0 100644 --- a/core/circuitbreaker/rule.go +++ b/core/circuitbreaker/rule.go @@ -126,12 +126,8 @@ func (r *Rule) isEqualsTo(newRule *Rule) bool { func getRuleStatSlidingWindowBucketCount(r *Rule) uint32 { interval := r.StatIntervalMs bucketCount := r.StatSlidingWindowBucketCount - if bucketCount == 0 { + if bucketCount == 0 || interval%bucketCount != 0 { bucketCount = 1 - } else { - if interval%bucketCount != 0 { - bucketCount = 1 - } } return bucketCount }