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", "module-failed-stop",
fmt.Sprintf("failed to stop module: %s", err.Error()), fmt.Sprintf("failed to stop module: %s", err.Error()),
) )
} else { }
// Always set to offline in order to let other modules shutdown in order.
m.Lock() m.Lock()
m.status = StatusOffline m.status = StatusOffline
m.Unlock() m.Unlock()
m.notifyOfChange() m.notifyOfChange()
}
// send report // send report
reports <- &report{ reports <- &report{
module: m, module: m,