aboutsummaryrefslogtreecommitdiffstats
path: root/modules/templates/helper.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-02-24 18:23:13 +0800
committerGitHub <noreply@github.com>2023-02-24 18:23:13 +0800
commit91fa0eb9d7b8c1bb5afac9d68161cf95ae0a02f8 (patch)
treee2e552ec7ec356af752411d8b595e81c1d28ed24 /modules/templates/helper.go
parentedf98a2dc30956c8e04b778bb7f1ce55c14ba963 (diff)
downloadgitea-91fa0eb9d7b8c1bb5afac9d68161cf95ae0a02f8.tar.gz
gitea-91fa0eb9d7b8c1bb5afac9d68161cf95ae0a02f8.zip
Avoid warning for system setting when start up (#23054)
Partially fix #23050 After #22294 merged, it always has a warning log like `cannot get context cache` when starting up. This should not affect any real life but it's annoying. This PR will fix the problem. That means when starting up, getting the system settings will not try from the cache but will read from the database directly. --------- Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r--modules/templates/helper.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index b7bd07670c..17ac68dc6b 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -92,7 +92,7 @@ func NewFuncMap() []template.FuncMap {
return setting.AssetVersion
},
"DisableGravatar": func(ctx context.Context) bool {
- return system_model.GetSettingBool(ctx, system_model.KeyPictureDisableGravatar)
+ return system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar)
},
"DefaultShowFullName": func() bool {
return setting.UI.DefaultShowFullName