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

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

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ func GetSettingByName(name string) string {
// 尝试数据库中查找
result := DB.Where("name = ?", name).First(&setting)
if result.Error == nil {
_ = cache.Set(cacheKey, setting.Value)
_ = cache.Set(cacheKey, setting.Value, -1)
return setting.Value
}
return ""