mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-22 23:21:45 +00:00
Fix time-based cache expiration practically never working.
config.MaxAge is now a nanosecond value, and multiplying it by time.Second (number of nanoseconds in a second) will make it too large for the cache expiry algorithm to have any effect.
This commit is contained in:
@@ -121,7 +121,7 @@ func makeCacheOptions[K comparable, V any](
|
||||
options.Weigher = weigher
|
||||
}
|
||||
if config.MaxAge != 0 {
|
||||
options.ExpiryCalculator = otter.ExpiryWriting[K, V](time.Duration(config.MaxAge) * time.Second)
|
||||
options.ExpiryCalculator = otter.ExpiryWriting[K, V](time.Duration(config.MaxAge))
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user