Skip to content

Commit 4c54a9e

Browse files
committed
fix: settings init issue #66
1 parent 83883c1 commit 4c54a9e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ import (
2121
)
2222

2323
func main() {
24+
var confPath string
25+
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
26+
flag.Parse()
27+
28+
settings.Init(confPath)
29+
30+
gin.SetMode(settings.ServerSettings.RunMode)
31+
2432
r, err := service.GetRuntimeInfo()
2533

2634
if err != nil {
@@ -33,21 +41,13 @@ func main() {
3341
Fetcher: &fetcher.File{Path: r.ExPath},
3442
TerminateTimeout: 0,
3543
})
36-
3744
}
3845

3946
func prog(state overseer.State) {
4047
// Hack: fix wrong Content Type of .js file on some OS platforms
4148
// See https://github.com/golang/go/issues/32350
4249
_ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8")
4350

44-
var confPath string
45-
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
46-
flag.Parse()
47-
48-
gin.SetMode(settings.ServerSettings.RunMode)
49-
50-
settings.Init(confPath)
5151
log.Printf("Nginx config dir path: %s", nginx.GetConfPath())
5252
if "" != settings.ServerSettings.JwtSecret {
5353
model.Init()

0 commit comments

Comments
 (0)