Move pidfile creation from setting to web cmd package (#23285)

Creating pid file should not belong to setting package and only web
command needs that. So this PR moves pidfile creation from setting
package to web command package to keep setting package more readable.

I marked this as `break` because the PIDFile path moved. For those who
have used the pid build argument, it has to be changed.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
Lunny XiaoandKN4CK3R authored and GitHub committed 2023-03-16 15:22:54 +08:00
1 parent 0f2361fedd
commit 623a539f23
4 files changed
+42 -41

No files matched your search

+5 -1
View File
@@ -54,7 +54,11 @@ var (
// LoadDBSetting loads the database settings
func LoadDBSetting() {
sec := CfgProvider.Section("database")
loadDBSetting(CfgProvider)
}
func loadDBSetting(rootCfg ConfigProvider) {
sec := rootCfg.Section("database")
Database.Type = DatabaseType(sec.Key("DB_TYPE").String())
defaultCharset := "utf8"