mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
cache/filecache: Add a :project placeholder
This allows for "cache per Hugo project", making `hugo --gc` work as expected, even if you have several Hugo projects running on the same PC. See #5439
This commit is contained in:
5
cache/filecache/filecache.go
vendored
5
cache/filecache/filecache.go
vendored
@@ -272,7 +272,10 @@ func (c *Cache) getOrRemove(id string) hugio.ReadSeekCloser {
|
||||
}
|
||||
|
||||
func (c *Cache) isExpired(modTime time.Time) bool {
|
||||
return c.maxAge >= 0 && time.Now().Sub(modTime) > c.maxAge
|
||||
if c.maxAge < 0 {
|
||||
return false
|
||||
}
|
||||
return c.maxAge == 0 || time.Now().Sub(modTime) > c.maxAge
|
||||
}
|
||||
|
||||
// For testing
|
||||
|
Reference in New Issue
Block a user