aboutsummaryrefslogtreecommitdiff
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao2023-02-24 18:23:13 +0800
committerGitHub2023-02-24 18:23:13 +0800
commit91fa0eb9d7b8c1bb5afac9d68161cf95ae0a02f8 (patch)
treee2e552ec7ec356af752411d8b595e81c1d28ed24 /routers
parentedf98a2dc30956c8e04b778bb7f1ce55c14ba963 (diff)
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 'routers')
-rw-r--r--routers/init.go2
-rw-r--r--routers/web/admin/config.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/init.go b/routers/init.go
index 6a51de669..d3f822dc8 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -150,7 +150,7 @@ func GlobalInitInstalled(ctx context.Context) {
mustInit(system.Init)
mustInit(oauth2.Init)
- mustInit(models.Init)
+ mustInitCtx(ctx, models.Init)
mustInit(repo_service.Init)
// Booting long running goroutines.
diff --git a/routers/web/admin/config.go b/routers/web/admin/config.go
index 2566cbe42..075fb423d 100644
--- a/routers/web/admin/config.go
+++ b/routers/web/admin/config.go
@@ -103,7 +103,7 @@ func Config(ctx *context.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminConfig"] = true
- systemSettings, err := system_model.GetAllSettings()
+ systemSettings, err := system_model.GetAllSettings(ctx)
if err != nil {
ctx.ServerError("system_model.GetAllSettings", err)
return