Skip to content

Commit

Permalink
Update backend/pkg/commons/ratelimit/ratelimit.go
Browse files Browse the repository at this point in the history
Co-authored-by: Lucca <[email protected]>
  • Loading branch information
guybrush and LuccaBitfly authored Jul 31, 2024
1 parent 5978301 commit f599336
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions backend/pkg/commons/ratelimit/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,7 @@ func updateWeights(firstRun bool) error {
if !firstRun && oldWeights[w.Endpoint] != weights[w.Endpoint] {
log.InfoWithFields(log.Fields{"endpoint": w.Endpoint, "weight": w.Weight, "oldWeight": oldWeights[w.Endpoint]}, "weight changed")
}
buckets[w.Endpoint] = strings.ReplaceAll(w.Bucket, ":", "_")
if buckets[w.Endpoint] == "" {
buckets[w.Endpoint] = defaultBucket
}
buckets[w.Endpoint] = cmp.Or(strings.ReplaceAll(w.Bucket, ":", "_"), defaultBucket)
if !firstRun && oldBuckets[w.Endpoint] != buckets[w.Endpoint] {
log.InfoWithFields(log.Fields{"endpoint": w.Endpoint, "bucket": w.Weight, "oldBucket": oldBuckets[w.Endpoint]}, "bucket changed")
}
Expand Down

0 comments on commit f599336

Please sign in to comment.