mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Merge setting.InitXXX into one function with options (#24389)
This PR will merge 3 Init functions on setting packages as 1 and introduce an options struct.
This commit is contained in:
parent
a2fe68e50b
commit
377a0a20f0
28 changed files with 104 additions and 137 deletions
|
@ -15,8 +15,9 @@ import (
|
|||
|
||||
// PreloadSettings preloads the configuration to check if we need to run install
|
||||
func PreloadSettings(ctx context.Context) bool {
|
||||
setting.InitProviderAllowEmpty()
|
||||
setting.LoadCommonSettings()
|
||||
setting.Init(&setting.Options{
|
||||
AllowEmpty: true,
|
||||
})
|
||||
if !setting.InstallLock {
|
||||
log.Info("AppPath: %s", setting.AppPath)
|
||||
log.Info("AppWorkPath: %s", setting.AppWorkPath)
|
||||
|
@ -38,8 +39,7 @@ func PreloadSettings(ctx context.Context) bool {
|
|||
|
||||
// reloadSettings reloads the existing settings and starts up the database
|
||||
func reloadSettings(ctx context.Context) {
|
||||
setting.InitProviderFromExistingFile()
|
||||
setting.LoadCommonSettings()
|
||||
setting.Init(&setting.Options{})
|
||||
setting.LoadDBSetting()
|
||||
if setting.InstallLock {
|
||||
if err := common.InitDBEngine(ctx); err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue