From 18b14db725a106604f1c659fe7373dcc05a3ba80 Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Sun, 21 Jan 2024 23:53:40 -0300 Subject: [PATCH] fix: owners set correct UNDER_LIMIT status --- global.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/global.go b/global.go index 78431960..f5dfada9 100644 --- a/global.go +++ b/global.go @@ -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,