]> git.lizzy.rs Git - go-anidb.git/blobdiff - filecache.go
anidb: Make cached *File expire earlier if they're Incomplete
[go-anidb.git] / filecache.go
index a5175ee84e7a027397ccde2c4028eedbb331e76c..e3ae93c03911d5f4d84fdcf5373fc89e1a0c0476 100644 (file)
@@ -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
 }