aboutsummaryrefslogtreecommitdiffhomepage
path: root/cache
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-23 17:56:29 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-23 17:56:29 +0100
commit03b88c6ddbbd6b22022b195d63fbbfd5a08c5a2b (patch)
treef08bc532536accd2c691f8c482f055ae6e87ae1d /cache
parent7ee0f70507cb33c72e8f10d2f60db205eb15e3f1 (diff)
downloadhugo-03b88c6ddbbd6b22022b195d63fbbfd5a08c5a2b.tar.gz
hugo-03b88c6ddbbd6b22022b195d63fbbfd5a08c5a2b.zip
cache/dynacache: Reset ticker in case one cache eviction takes some time
Updates #12129
Diffstat (limited to 'cache')
-rw-r--r--cache/dynacache/dynacache.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/cache/dynacache/dynacache.go b/cache/dynacache/dynacache.go
index 85b360138..fed4d120e 100644
--- a/cache/dynacache/dynacache.go
+++ b/cache/dynacache/dynacache.go
@@ -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