]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Correct inverted test in FileByEd2kSize
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Fri, 26 Jul 2013 05:32:38 +0000 (02:32 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Fri, 26 Jul 2013 05:32:38 +0000 (02:32 -0300)
Resulted in always having cache misses.

filecache.go

index 564f84fb6a1cc5aabe3d2afb7d26bf35cb5fa09e..e590a73d7bc529ba07272a2afeb1f2c7c74ac872 100644 (file)
@@ -152,7 +152,7 @@ func (adb *AniDB) FileByEd2kSize(ed2k string, size int64) <-chan *File {
        fid := FID(0)
 
        switch ts, err := Cache.Get(&fid, key...); {
-       case err != nil && time.Now().Sub(ts) < FileCacheDuration:
+       case err == nil && time.Now().Sub(ts) < FileCacheDuration:
                intentMap.NotifyClose(fid, key...)
                return ch
        }