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>
This commit is contained in:
parent
ce5aafbc69
commit
385462d36c
12 changed files with 172 additions and 151 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue