From cf6591ace19b78a147dccdf3ed10c545b928e31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Mon, 18 Nov 2024 10:22:55 +0100 Subject: [PATCH] using the defined function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- monitor/mqtt_monitor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/monitor/mqtt_monitor.go b/monitor/mqtt_monitor.go index 3234b81..7300888 100644 --- a/monitor/mqtt_monitor.go +++ b/monitor/mqtt_monitor.go @@ -296,9 +296,7 @@ func (mms *MqttMonitor) onConnectionLost(_ mqtt.Client, err error) { Log("connection lost: " + err.Error()) // Handle connection loss here (e.g., reconnect attempts, logging) if !mms.IsTerminated() { - mms.lostConnectionMutex.Lock() - mms.lostConnection = true - mms.lostConnectionMutex.Unlock() + mms.setConnectionStatus(true) } }