mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -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 {
|
if !ok {
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
if co.TTL <= 0 {
|
||||||
|
return co.Value, true
|
||||||
|
}
|
||||||
expired := time.Now().Unix() >= (co.Timestamp + int64(co.TTL)*60)
|
expired := time.Now().Unix() >= (co.Timestamp + int64(co.TTL)*60)
|
||||||
if expired {
|
if expired {
|
||||||
fc.cache.remove(key)
|
fc.cache.remove(key)
|
||||||
|
|
Loading…
Reference in a new issue