1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2024-12-27 00:12:31 +01:00

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

View File

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