Merge pull request 'app Shutdown uses shutdownPeer' (#459) from fixShutdown into master
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
Reviewed-on: #459
This commit is contained in:
commit
f52919271c
19
app/app.go
19
app/app.go
|
@ -341,22 +341,11 @@ func (app *application) shutdownPeer(onion string) {
|
||||||
|
|
||||||
// Shutdown shutsdown all peers of an app
|
// Shutdown shutsdown all peers of an app
|
||||||
func (app *application) Shutdown() {
|
func (app *application) Shutdown() {
|
||||||
for id, peer := range app.peers {
|
app.appmutex.Lock()
|
||||||
|
defer app.appmutex.Unlock()
|
||||||
|
for id := range app.peers {
|
||||||
log.Debugf("Shutting Down Peer %v", id)
|
log.Debugf("Shutting Down Peer %v", id)
|
||||||
peer.Shutdown()
|
app.shutdownPeer(id)
|
||||||
log.Debugf("Shutting Down Plugins for %v", id)
|
|
||||||
app.plugins.Range(func(k, v interface{}) bool {
|
|
||||||
log.Debugf("shutting down plugins for %v", k)
|
|
||||||
app.ShutdownPeer(k.(string))
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
log.Debugf("Shutting Down Engines for %v", id)
|
|
||||||
if _, ok := app.engines[id]; ok {
|
|
||||||
app.engines[id].Shutdown()
|
|
||||||
}
|
|
||||||
log.Debugf("Shutting Down Bus for %v", id)
|
|
||||||
app.eventBuses[id].Shutdown()
|
|
||||||
log.Debugf("Done Shutdown for peer %v", id)
|
|
||||||
}
|
}
|
||||||
log.Debugf("Shutting Down App")
|
log.Debugf("Shutting Down App")
|
||||||
app.appBus.Shutdown()
|
app.appBus.Shutdown()
|
||||||
|
|
Loading…
Reference in New Issue