mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
Adding logic to prevent ”non-positive interval for newticker” (WIP) (#10532)
* Adding logic to prevent `”non-positive interval for newticker”` * Update vault/quotas/quotas_rate_limit.go --------- Co-authored-by: Violet Hynes <a.xenasis@gmail.com> Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user