1
0
Fork 0
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:
hellerve 2016-12-21 12:16:29 +01:00
parent 41b90c7a3c
commit b340c2b79e

View file

@ -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
}