summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
authorYarden Shoham <hrsi88@gmail.com>2023-02-24 23:46:11 +0200
committerGitHub <noreply@github.com>2023-02-24 16:46:11 -0500
commit7c3196ceaca30411e5fbfd45eb7ac28b261a85c2 (patch)
tree3c69014fd18047eb0252c2e49f2fb346d92fd2b4 /modules/templates
parent80c1264f4b88e7e2490b0d6f5f32d84a6936b50e (diff)
downloadgitea-7c3196ceaca30411e5fbfd45eb7ac28b261a85c2.tar.gz
gitea-7c3196ceaca30411e5fbfd45eb7ac28b261a85c2.zip
Avoid warning for system setting when start up (#23054) (#23116)
Backport #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: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/templates')
-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