mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-11 16:09:26 +00:00
fix lock releasing in mqtt client on error
This commit is contained in:
@@ -148,13 +148,13 @@ func (mc *MQTTClient) Start(ctx context.Context, inputHandler common.InputHandle
|
|||||||
mc.client = mqtt.NewClient(opts)
|
mc.client = mqtt.NewClient(opts)
|
||||||
|
|
||||||
token := mc.client.Connect()
|
token := mc.client.Connect()
|
||||||
|
mc.clientMu.Unlock()
|
||||||
|
|
||||||
token.Wait()
|
token.Wait()
|
||||||
err := token.Error()
|
err := token.Error()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
mc.clientMu.Unlock()
|
|
||||||
|
|
||||||
<-mc.ctx.Done()
|
<-mc.ctx.Done()
|
||||||
mc.logger.Debug("done")
|
mc.logger.Debug("done")
|
||||||
|
|||||||
Reference in New Issue
Block a user