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

This commit is contained in:
GoEdgeLab
2024-03-22 10:05:01 +08:00
parent 75a4cc490f
commit f4c4a2d5fa

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