add expiry/size to otp

This commit is contained in:
Asim Aslam
2021-06-08 11:15:47 +01:00
parent 702fda8269
commit 9437ca4b86
4 changed files with 93 additions and 37 deletions

2
pkg/cache/cache.go vendored
View File

@@ -103,6 +103,7 @@ func (c *cache) Get(key string, val interface{}) error {
if err != nil && err == store.ErrNotFound {
return ErrNotFound
} else if err != nil {
return err
}
if len(recs) == 0 {
return ErrNotFound
@@ -111,6 +112,7 @@ func (c *cache) Get(key string, val interface{}) error {
return err
}
// put it in the cache for future use
// set in the lru
rec := recs[0]