summaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorsatotake <doublequotation@gmail.com>2022-04-27 02:57:04 +0900
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-05-08 16:56:26 +0200
commite77ca3c105bd64c5077d823d2127f6f812a4f681 (patch)
treeebbe9c310bfab1e34f9fd2e36b738fd2a37d6f11 /cache
parentf2946da9e806c2bafbdd26707fe339db79bd980b (diff)
Add `clock` cli flag
Close #8787
Diffstat (limited to 'cache')
-rw-r--r--cache/filecache/filecache.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cache/filecache/filecache.go b/cache/filecache/filecache.go
index 5a87382ae..3104d8ac6 100644
--- a/cache/filecache/filecache.go
+++ b/cache/filecache/filecache.go
@@ -24,6 +24,7 @@ import (
"sync"
"time"
+ "github.com/gohugoio/hugo/common/htime"
"github.com/gohugoio/hugo/common/hugio"
"github.com/gohugoio/hugo/helpers"
@@ -295,7 +296,7 @@ func (c *Cache) isExpired(modTime time.Time) bool {
if c.maxAge < 0 {
return false
}
- return c.maxAge == 0 || time.Since(modTime) > c.maxAge
+ return c.maxAge == 0 || htime.Since(modTime) > c.maxAge
}
// For testing