diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-05-04 11:55:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-04 11:55:35 +0800 |
commit | 377a0a20f01a62f15a1504a3bba6cf6cc0c98bea (patch) | |
tree | e86a1818f23be1605a4cd707fadc7dcdce546d18 /routers/install | |
parent | a2fe68e50ba819daed9b0e28166a749d18c58750 (diff) | |
download | gitea-377a0a20f01a62f15a1504a3bba6cf6cc0c98bea.tar.gz gitea-377a0a20f01a62f15a1504a3bba6cf6cc0c98bea.zip |
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.
Diffstat (limited to 'routers/install')
-rw-r--r-- | routers/install/setting.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/install/setting.go b/routers/install/setting.go index dadefa26a2..c14843d8ee 100644 --- a/routers/install/setting.go +++ b/routers/install/setting.go @@ -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 { |