diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-07 11:11:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-07 11:11:27 +0800 |
commit | 69b61d437357235700306f28d22d21acc39bb2b5 (patch) | |
tree | 33af1d4d797b428556a323837fcc3eda38a54479 /cmd/cmd.go | |
parent | c9110eb5e4657e018695f084f37e1b423939e9e0 (diff) | |
download | gitea-69b61d437357235700306f28d22d21acc39bb2b5.tar.gz gitea-69b61d437357235700306f28d22d21acc39bb2b5.zip |
Fix bug on admin subcommand (#17533)
* Fix bug on admin subcommand
* Add signals for all initDB
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'cmd/cmd.go')
-rw-r--r-- | cmd/cmd.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/cmd.go b/cmd/cmd.go index ea025cd98e..b89dd5d8b8 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -56,16 +56,15 @@ func confirm() (bool, error) { } } -func initDB() error { - return initDBDisableConsole(false) +func initDB(ctx context.Context) error { + return initDBDisableConsole(ctx, false) } -func initDBDisableConsole(disableConsole bool) error { +func initDBDisableConsole(ctx context.Context, disableConsole bool) error { setting.NewContext() setting.InitDBConfig() - setting.NewXORMLogService(disableConsole) - if err := db.InitEngine(); err != nil { + if err := db.InitEngine(ctx); err != nil { return fmt.Errorf("models.SetEngine: %v", err) } return nil |