Skip to content

Commit

Permalink
Adding logic to prevent ”non-positive interval for newticker” (WIP) (
Browse files Browse the repository at this point in the history
…#10532)

* Adding logic to prevent `”non-positive interval for newticker”`

* Update vault/quotas/quotas_rate_limit.go

---------

Co-authored-by: Violet Hynes <[email protected]>
Co-authored-by: Violet Hynes <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2023
1 parent d5b29f6 commit b2249b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vault/quotas/quotas_rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ func (rlq *RateLimitQuota) initialize(logger log.Logger, ms *metricsutil.Cluster
// in which we stop the ticker and return.
func (rlq *RateLimitQuota) purgeBlockedClients() {
rlq.lock.RLock()
if rlq.purgeInterval <= 0 {
rlq.purgeInterval = DefaultRateLimitPurgeInterval
}
ticker := time.NewTicker(rlq.purgeInterval)
rlq.lock.RUnlock()

Expand Down

0 comments on commit b2249b0

Please sign in to comment.