Fix: failed unit test / Feat: support TTL in redis cache

This commit is contained in:
HFO4
2019-12-13 13:22:10 +08:00
parent 8703f97e20
commit afc0b647ca
14 changed files with 78 additions and 369 deletions

View File

@@ -66,7 +66,7 @@ func (service *ItemService) Archive(ctx context.Context, c *gin.Context) seriali
finalURL := siteURL.ResolveReference(signedURI).String()
// 将压缩文件记录存入缓存
err = cache.Set("archive_"+zipID, zipFile)
err = cache.Set("archive_"+zipID, zipFile, 120)
if err != nil {
return serializer.Err(serializer.CodeIOFailed, "无法写入缓存", err)
}