mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-17 12:23:22 +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)
|
||||
|
||||
token := mc.client.Connect()
|
||||
mc.clientMu.Unlock()
|
||||
|
||||
token.Wait()
|
||||
err := token.Error()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
mc.clientMu.Unlock()
|
||||
|
||||
<-mc.ctx.Done()
|
||||
mc.logger.Debug("done")
|
||||
|
||||
Reference in New Issue
Block a user