mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-15 18:50:41 -07:00
Add in jitter in case there are many that all try to cleanuo at the same time
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1567,7 +1567,8 @@ func (o *consumer) deleteNotActive() {
|
||||
startInterval = 5 * time.Second
|
||||
maxInterval = 5 * time.Minute
|
||||
)
|
||||
interval := startInterval
|
||||
jitter := time.Duration(rand.Int63n(int64(startInterval)))
|
||||
interval := startInterval + jitter
|
||||
ticker := time.NewTicker(interval)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
|
||||
Reference in New Issue
Block a user