From: Diogo Franco (Kovensky) Date: Sun, 14 Jul 2013 18:03:46 +0000 (-0300) Subject: anidb: Make cached *File expire earlier if they're Incomplete X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=36351396fa6db3dfc295b63fd1f3f267b0d82c30;p=go-anidb.git anidb: Make cached *File expire earlier if they're Incomplete --- diff --git a/filecache.go b/filecache.go index a5175ee..e3ae93c 100644 --- a/filecache.go +++ b/filecache.go @@ -25,6 +25,9 @@ func (f *File) IsStale() bool { if f == nil { return true } + if f.Incomplete { + return time.Now().Sub(f.Cached) > FileIncompleteCacheDuration + } return time.Now().Sub(f.Cached) > FileCacheDuration }