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

@@ -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 ""