From b0502dee7f86bc8080d3564a58d103bae6fe5acd Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Thu, 8 Feb 2024 12:07:07 -0300 Subject: [PATCH] remove logs and add comment Co-authored-by: Yamil Asusta --- global.go | 2 -- gubernator.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/global.go b/global.go index 2f44cb8e..fc6c7983 100644 --- a/global.go +++ b/global.go @@ -163,7 +163,6 @@ func (gm *globalManager) sendHits(hits map[string]*RateLimitReq) { fan.Run(func(in interface{}) error { p := in.(*pair) ctx, cancel := context.WithTimeout(context.Background(), gm.conf.GlobalTimeout) - gm.log.Infof("calling owner of key: %s with hits: %d", p.req.Requests[0].UniqueKey, p.req.Requests[0].Hits) _, err := p.client.GetPeerRateLimits(ctx, &p.req) cancel() @@ -240,7 +239,6 @@ func (gm *globalManager) broadcastPeers(ctx context.Context, updates map[string] fan.Run(func(in interface{}) error { peer := in.(*PeerClient) ctx, cancel := context.WithTimeout(ctx, gm.conf.GlobalTimeout) - gm.log.Infof("calling peer of key: %s with hits: %d", req.Globals[0].Key, req.Globals[0].Status.Remaining) _, err := peer.UpdatePeerGlobals(ctx, &req) cancel() diff --git a/gubernator.go b/gubernator.go index 06653f60..89e875fb 100644 --- a/gubernator.go +++ b/gubernator.go @@ -432,7 +432,7 @@ func (s *V1Instance) UpdatePeerGlobals(ctx context.Context, r *UpdatePeerGlobals now := MillisecondNow() for _, g := range r.Globals { item := &CacheItem{ - ExpireAt: g.Status.ResetTime + 100000, + ExpireAt: g.Status.ResetTime + 1000, // account for clock drift from owner where `ResetTime` might already be less than current time of the local machine. Algorithm: g.Algorithm, Key: g.Key, }