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

Commit

Permalink
another undo of a rename
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Feb 19, 2024
1 parent f738e1e commit c268a80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions global.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (gm *globalManager) runBroadcasts() {
// Send the hits if we reached our batch limit
if len(updates) >= gm.conf.GlobalBatchLimit {
gm.metricBroadcastCounter.WithLabelValues("queue_full").Inc()
gm.sendUpdatesToPeers(context.Background(), updates)
gm.broadcastPeers(context.Background(), updates)
updates = make(map[string]*RateLimitReq)
return true
}
Expand All @@ -203,7 +203,7 @@ func (gm *globalManager) runBroadcasts() {
case <-interval.C:
if len(updates) != 0 {
gm.metricBroadcastCounter.WithLabelValues("timer").Inc()
gm.sendUpdatesToPeers(context.Background(), updates)
gm.broadcastPeers(context.Background(), updates)
updates = make(map[string]*RateLimitReq)
} else {
gm.metricGlobalQueueLength.Set(0)
Expand All @@ -215,8 +215,8 @@ func (gm *globalManager) runBroadcasts() {
})
}

// sendUpdatesToPeers broadcasts global rate limit statuses to all other peers
func (gm *globalManager) sendUpdatesToPeers(ctx context.Context, updates map[string]*RateLimitReq) {
// broadcastPeers broadcasts global rate limit statuses to all other peers
func (gm *globalManager) broadcastPeers(ctx context.Context, updates map[string]*RateLimitReq) {
defer prometheus.NewTimer(gm.metricBroadcastDuration).ObserveDuration()
var req UpdatePeerGlobalsReq

Expand Down

0 comments on commit c268a80

Please sign in to comment.