mirror of
https://github.com/alice-lg/birdwatcher.git
synced 2025-03-09 00:00:05 +01:00
hotfix: caching should reset
This commit is contained in:
parent
41b90c7a3c
commit
b340c2b79e
1 changed files with 9 additions and 0 deletions
|
@ -23,6 +23,15 @@ func fromCache(key string) (Parsed, bool) {
|
|||
Cache.RLock()
|
||||
val, ok := Cache.m[key]
|
||||
Cache.RUnlock()
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
ttl, correct := val["ttl"].(time.Time)
|
||||
if !correct || ttl.Before(time.Now()) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
return val, ok
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue