rework module shutdown process to cancel module context in defer

This commit is contained in:
Joel Wetzell
2026-05-27 20:50:33 -05:00
parent 52ca801fbd
commit 0b494fce91
21 changed files with 197 additions and 216 deletions
+1 -2
View File
@@ -152,6 +152,7 @@ func (mc *MQTTClient) Start(ctx context.Context, inputHandler common.InputHandle
mc.clientMu.Unlock()
<-mc.ctx.Done()
mc.logger.Debug("done")
return nil
}
@@ -189,7 +190,5 @@ func (mc *MQTTClient) Stop() {
defer mc.clientMu.Unlock()
if mc.client != nil {
mc.client.Disconnect(250)
mc.client = nil
}
mc.logger.Debug("done")
}