fixes issue #425 (#438)

This commit is contained in:
Kevin Wan
2021-02-05 13:32:56 +08:00
committed by GitHub
parent 7b3c3de35e
commit b88ba14597
6 changed files with 32 additions and 17 deletions

View File

@@ -82,6 +82,11 @@ func (c cacheNode) GetCache(key string, v interface{}) error {
}
}
// IsNotFound checks if the given error is the defined errNotFound.
func (c cacheNode) IsNotFound(err error) bool {
return err == c.errNotFound
}
// SetCache sets the cache with key and v, using c.expiry.
func (c cacheNode) SetCache(key string, v interface{}) error {
return c.SetCacheWithExpire(key, v, c.aroundDuration(c.expiry))