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

Commit

Permalink
remove logs and add comment
Browse files Browse the repository at this point in the history
Co-authored-by: Yamil Asusta <[email protected]>
  • Loading branch information
2 people authored and thrawn01 committed Feb 21, 2024
1 parent 8b8a4b9 commit b0502de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions global.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit b0502de

Please sign in to comment.