aboutsummaryrefslogtreecommitdiffstats
path: root/modules/cache
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-06-12 21:41:28 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-06-12 15:41:28 -0400
commitf9ec2f89f2265bc1371a6c62359de9816534fa6b (patch)
treef48b138a457e5ac6cf843bbb38400926704370f7 /modules/cache
parent5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff)
downloadgitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz
gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip
Add golangci (#6418)
Diffstat (limited to 'modules/cache')
-rw-r--r--modules/cache/cache.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/cache/cache.go b/modules/cache/cache.go
index a2d6c724c8..a7412f109f 100644
--- a/modules/cache/cache.go
+++ b/modules/cache/cache.go
@@ -43,7 +43,10 @@ func GetInt(key string, getFunc func() (int, error)) (int, error) {
if value, err = getFunc(); err != nil {
return value, err
}
- conn.Put(key, value, int64(setting.CacheService.TTL.Seconds()))
+ err = conn.Put(key, value, int64(setting.CacheService.TTL.Seconds()))
+ if err != nil {
+ return 0, err
+ }
}
switch value := conn.Get(key).(type) {
case int:
@@ -72,7 +75,10 @@ func GetInt64(key string, getFunc func() (int64, error)) (int64, error) {
if value, err = getFunc(); err != nil {
return value, err
}
- conn.Put(key, value, int64(setting.CacheService.TTL.Seconds()))
+ err = conn.Put(key, value, int64(setting.CacheService.TTL.Seconds()))
+ if err != nil {
+ return 0, err
+ }
}
switch value := conn.Get(key).(type) {
case int64:
@@ -93,5 +99,5 @@ func Remove(key string) {
if conn == nil {
return
}
- conn.Delete(key)
+ _ = conn.Delete(key)
}