diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-11-10 14:43:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 14:43:53 +0800 |
commit | 385462d36c75e809ee082d3432941f938cbdffc9 (patch) | |
tree | 938946297d1c0fa736852e1054f732ed2b0db686 /routers/web | |
parent | ce5aafbc698de72d8acf03851dc5db057b3cc01f (diff) | |
download | gitea-385462d36c75e809ee082d3432941f938cbdffc9.tar.gz gitea-385462d36c75e809ee082d3432941f938cbdffc9.zip |
Fix dashboard ignored system setting cache (#21621)
This is a performance regression from #18058
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/admin/config.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/web/admin/config.go b/routers/web/admin/config.go index 614d3d4f66..792eec8d56 100644 --- a/routers/web/admin/config.go +++ b/routers/web/admin/config.go @@ -18,7 +18,6 @@ import ( "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" - system_module "code.gitea.io/gitea/modules/system" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/services/mailer" @@ -203,7 +202,11 @@ func ChangeConfig(ctx *context.Context) { value := ctx.FormString("value") version := ctx.FormInt("version") - if err := system_module.SetSetting(key, value, version); err != nil { + if err := system_model.SetSetting(&system_model.Setting{ + SettingKey: key, + SettingValue: value, + Version: version, + }); err != nil { log.Error("set setting failed: %v", err) ctx.JSON(http.StatusOK, map[string]string{ "err": ctx.Tr("admin.config.set_setting_failed", key), |