From 828af286585e58271f58176cfaaad03baac7b559 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 31 Oct 2019 17:36:28 +0100 Subject: [PATCH] Revert "move ConfigLoad and InitPluginsGlobals to appMain" This reverts commit b67d19ffb3982a527172bb34e35a1456b5574f9d. --- dnscrypt-proxy/main.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 568b0e62..57409979 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -109,7 +109,15 @@ func main() { } func (app *App) Start(service service.Service) error { - go app.appMain() + 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() + }() return nil } @@ -123,12 +131,6 @@ 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() }