Skip to content

Commit

Permalink
Optimize code in core/circuitbreaker/rule.go (alibaba#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylitianrui authored Jul 19, 2021
1 parent 0e9ae33 commit d022a91
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/circuitbreaker/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d022a91

Please sign in to comment.