Skip to content

Commit

Permalink
Remove race over b.store / redis in TT-5235
Browse files Browse the repository at this point in the history
  • Loading branch information
titpetric committed May 6, 2022
1 parent 9011dfa commit 58b304a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gateway/auth_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ func (b *DefaultSessionManager) ResetQuota(keyName string, session *user.Session

rateLimiterSentinelKey := RateLimitKeyPrefix + keyName + ".BLOCKED"
// Clear the rate limiter
go b.store.DeleteRawKey(rateLimiterSentinelKey)
b.store.DeleteRawKey(rateLimiterSentinelKey)
// Fix the raw key
go b.store.DeleteRawKey(rawKey)
//go b.store.SetKey(rawKey, "0", session.QuotaRenewalRate)
b.store.DeleteRawKey(rawKey)
//b.store.SetKey(rawKey, "0", session.QuotaRenewalRate)

for _, acl := range session.AccessRights {
rawKey = QuotaKeyPrefix + acl.AllowanceScope + "-" + keyName
go b.store.DeleteRawKey(rawKey)
b.store.DeleteRawKey(rawKey)
}
}

Expand Down

0 comments on commit 58b304a

Please sign in to comment.