diff options
author | satotake <[email protected]> | 2022-04-27 02:57:04 +0900 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-05-08 16:56:26 +0200 |
commit | e77ca3c105bd64c5077d823d2127f6f812a4f681 (patch) | |
tree | ebbe9c310bfab1e34f9fd2e36b738fd2a37d6f11 /cache/filecache | |
parent | f2946da9e806c2bafbdd26707fe339db79bd980b (diff) | |
download | hugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.tar.gz hugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.zip |
Add `clock` cli flag
Close #8787
Diffstat (limited to 'cache/filecache')
-rw-r--r-- | cache/filecache/filecache.go | 3 |
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 |