diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-03-01 16:59:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 16:59:52 +0000 |
commit | bb2380c254b65a6586137e9e0ab9e08354aa19f4 (patch) | |
tree | c2840dc80cccd762f0037ee79cb7f778d20388f6 /internal/caching/caches.go | |
parent | 726529fe996519c93f4f329c03a968a432b0bb0e (diff) |
Allow specifying max age for caches (#2239)
* Allow specifying max age for caches
* Evict cache entry if it's found to be stale when we call Get
* Fix bugs
Diffstat (limited to 'internal/caching/caches.go')
-rw-r--r-- | internal/caching/caches.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/caching/caches.go b/internal/caching/caches.go index 39926d73..722405de 100644 --- a/internal/caching/caches.go +++ b/internal/caching/caches.go @@ -1,5 +1,7 @@ package caching +import "time" + // Caches contains a set of references to caches. They may be // different implementations as long as they satisfy the Cache // interface. @@ -19,3 +21,5 @@ type Cache interface { Set(key string, value interface{}) Unset(key string) } + +const CacheNoMaxAge = time.Duration(0) |