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:
parent
8f2c438c70
commit
b67d19ffb3
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user