Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
fix: owners set correct UNDER_LIMIT status
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Jan 22, 2024
1 parent a48a45d commit 18b14db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion global.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,15 @@ func (gm *globalManager) broadcastPeers(ctx context.Context, updates map[string]
SetBehavior(&rl.Behavior, Behavior_GLOBAL, false)
rl.Hits = 0

status, err := gm.instance.getLocalRateLimit(ctx, rl)
misleadingStatus, err := gm.instance.getLocalRateLimit(ctx, rl)
if err != nil {
gm.log.WithError(err).Errorf("while broadcasting update to peers for: '%s'", rl.HashKey())
continue
}
status := misleadingStatus
if misleadingStatus.Remaining == 0 {
status.Status = Status_OVER_LIMIT
}
// Build an UpdatePeerGlobalsReq
req.Globals = append(req.Globals, &UpdatePeerGlobal{
Algorithm: rl.Algorithm,
Expand Down

0 comments on commit 18b14db

Please sign in to comment.