summaryrefslogtreecommitdiffstats
path: root/models/user/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user/setting.go')
-rw-r--r--models/user/setting.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/user/setting.go b/models/user/setting.go
index 896f3c8da1..c88ec51dbd 100644
--- a/models/user/setting.go
+++ b/models/user/setting.go
@@ -54,13 +54,13 @@ func genSettingCacheKey(userID int64, key string) string {
}
// GetSetting returns the setting value via the key
-func GetSetting(uid int64, key string) (*Setting, error) {
- return cache.Get(genSettingCacheKey(uid, key), func() (*Setting, error) {
+func GetSetting(uid int64, key string) (string, error) {
+ return cache.GetString(genSettingCacheKey(uid, key), func() (string, error) {
res, err := GetSettingNoCache(uid, key)
if err != nil {
- return nil, err
+ return "", err
}
- return res, nil
+ return res.SettingValue, nil
})
}
@@ -155,7 +155,7 @@ func SetUserSetting(userID int64, key, value string) error {
return err
}
- _, err := cache.Set(genSettingCacheKey(userID, key), func() (string, error) {
+ _, err := cache.GetString(genSettingCacheKey(userID, key), func() (string, error) {
return value, upsertUserSettingValue(userID, key, value)
})