Fix dependency loop when a module fails to shut down

This commit is contained in:
Daniel 2020-11-24 16:12:36 +01:00
parent ab21e88ae9
commit 85e36e3d68

View file

@ -273,12 +273,14 @@ func (m *Module) stopAllTasks(reports chan *report) {
"module-failed-stop",
fmt.Sprintf("failed to stop module: %s", err.Error()),
)
} else {
m.Lock()
m.status = StatusOffline
m.Unlock()
m.notifyOfChange()
}
// Always set to offline in order to let other modules shutdown in order.
m.Lock()
m.status = StatusOffline
m.Unlock()
m.notifyOfChange()
// send report
reports <- &report{
module: m,