mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-30 04:21:19 -08:00
feat(cache): allow for non-expiring values
This commit is contained in:
parent
e5dd07fb9a
commit
3cca2104bb
|
@ -60,6 +60,9 @@ func (fc *fileCache) get(key string) (string, bool) {
|
|||
if !ok {
|
||||
return "", false
|
||||
}
|
||||
if co.TTL <= 0 {
|
||||
return co.Value, true
|
||||
}
|
||||
expired := time.Now().Unix() >= (co.Timestamp + int64(co.TTL)*60)
|
||||
if expired {
|
||||
fc.cache.remove(key)
|
||||
|
|
Loading…
Reference in a new issue