mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +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.
|
// in which we stop the ticker and return.
|
||||||
func (rlq *RateLimitQuota) purgeBlockedClients() {
|
func (rlq *RateLimitQuota) purgeBlockedClients() {
|
||||||
rlq.lock.RLock()
|
rlq.lock.RLock()
|
||||||
|
if rlq.purgeInterval <= 0 {
|
||||||
|
rlq.purgeInterval = DefaultRateLimitPurgeInterval
|
||||||
|
}
|
||||||
ticker := time.NewTicker(rlq.purgeInterval)
|
ticker := time.NewTicker(rlq.purgeInterval)
|
||||||
rlq.lock.RUnlock()
|
rlq.lock.RUnlock()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user