app Shutdown uses shutdownPeer
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Dan Ballard 2022-09-09 08:55:19 -07:00
parent 9554e428d2
commit c8d7ec80ed
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()