move ConfigLoad and InitPluginsGlobals to appMain

This commit is contained in:
Vladimir Bauer 2019-10-31 18:42:10 +05:00 committed by Frank Denis
parent 8f2c438c70
commit b67d19ffb3
1 changed files with 7 additions and 9 deletions

View File

@ -109,15 +109,7 @@ func main() {
} }
func (app *App) Start(service service.Service) error { func (app *App) Start(service service.Service) error {
go func() { go app.appMain()
if err := ConfigLoad(app.proxy, app.flags); err != nil {
dlog.Fatal(err)
}
if err := app.proxy.InitPluginsGlobals(); err != nil {
dlog.Fatal(err)
}
app.appMain()
}()
return nil return nil
} }
@ -131,6 +123,12 @@ func (app *App) Stop(service service.Service) error {
} }
func (app *App) appMain() { func (app *App) appMain() {
if err := ConfigLoad(app.proxy, app.flags); err != nil {
dlog.Fatal(err)
}
if err := app.proxy.InitPluginsGlobals(); err != nil {
dlog.Fatal(err)
}
pidfile.Write() pidfile.Write()
app.proxy.StartProxy() app.proxy.StartProxy()
} }