cache/dynacache: Reset ticker in case one cache eviction takes some time

Updates #12129
This commit is contained in:
Bjørn Erik Pedersen 2024-02-23 17:56:29 +01:00
parent 7ee0f70507
commit 03b88c6ddb
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -295,6 +295,8 @@ func (c *Cache) start() func() {
select {
case <-ticker.C:
c.adjustCurrentMaxSize()
// Reset the ticker to avoid drift.
ticker.Reset(c.opts.CheckInterval)
case <-quit:
ticker.Stop()
return