mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-23 23:29:15 +01:00
Rollback stopping management client within engine stop (#204)
* start close handler when using console * don't close management client within engine stop
This commit is contained in:
parent
0739038d51
commit
98dc5824ce
@ -22,11 +22,13 @@ var (
|
||||
Short: "install, login and start wiretrustee client",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
SetFlagsFromEnvVars()
|
||||
|
||||
err := loginCmd.RunE(cmd, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if logFile == "console" {
|
||||
SetupCloseHandler()
|
||||
return runClient()
|
||||
}
|
||||
|
||||
|
@ -96,13 +96,7 @@ func (e *Engine) Stop() error {
|
||||
e.syncMsgMux.Lock()
|
||||
defer e.syncMsgMux.Unlock()
|
||||
|
||||
err := e.mgmClient.Close()
|
||||
if err != nil {
|
||||
log.Errorf("failed closing engine's management client: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
err = e.removeAllPeers()
|
||||
err := e.removeAllPeers()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -351,7 +351,11 @@ func TestEngine_MultiplePeers(t *testing.T) {
|
||||
|
||||
// cleanup test
|
||||
for _, peerEngine := range engines {
|
||||
errStop := peerEngine.Stop()
|
||||
errStop := peerEngine.mgmClient.Close()
|
||||
if errStop != nil {
|
||||
log.Infoln("got error trying to close management clients from engine: ", errStop)
|
||||
}
|
||||
errStop = peerEngine.Stop()
|
||||
if errStop != nil {
|
||||
log.Infoln("got error trying to close testing peers engine: ", errStop)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user