From 4c54a9e43d40084d3249c03d37b930e3ea59d878 Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Sat, 4 Feb 2023 22:16:08 +0800 Subject: [PATCH] fix: settings init issue #66 --- main.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index f06271ad..f2890524 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,14 @@ import ( ) func main() { + var confPath string + flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file") + flag.Parse() + + settings.Init(confPath) + + gin.SetMode(settings.ServerSettings.RunMode) + r, err := service.GetRuntimeInfo() if err != nil { @@ -33,7 +41,6 @@ func main() { Fetcher: &fetcher.File{Path: r.ExPath}, TerminateTimeout: 0, }) - } func prog(state overseer.State) { @@ -41,13 +48,6 @@ func prog(state overseer.State) { // See https://github.com/golang/go/issues/32350 _ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8") - var confPath string - flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file") - flag.Parse() - - gin.SetMode(settings.ServerSettings.RunMode) - - settings.Init(confPath) log.Printf("Nginx config dir path: %s", nginx.GetConfPath()) if "" != settings.ServerSettings.JwtSecret { model.Init()