在缓存索引中判断缓存是否存在时增加过期时间检查

This commit is contained in:
刘祥超
2024-03-22 10:05:01 +08:00
parent 5a8ee34360
commit 22b4a4afbc

View File

@@ -160,6 +160,11 @@ func (this *SQLiteFileList) Exist(hash string) (bool, error) {
} }
return false, err return false, err
} }
if expiredAt < fasttime.Now().Unix() {
return false, nil
}
this.memoryCache.Write(hash, zero.Zero{}, this.maxExpiresAtForMemoryCache(expiredAt)) this.memoryCache.Write(hash, zero.Zero{}, this.maxExpiresAtForMemoryCache(expiredAt))
return true, nil return true, nil
} }