Merge pull request 'app Shutdown uses shutdownPeer' (#459) from fixShutdown into master
continuous-integration/drone/push Build is pending Details

Reviewed-on: #459
This commit is contained in:
Sarah Jamie Lewis 2022-09-09 16:31:56 +00:00
commit f52919271c
1 changed files with 4 additions and 15 deletions

View File

@ -341,22 +341,11 @@ func (app *application) shutdownPeer(onion string) {
// Shutdown shutsdown all peers of an app
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)
peer.Shutdown()
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)
app.shutdownPeer(id)
}
log.Debugf("Shutting Down App")
app.appBus.Shutdown()