using the defined function

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2024-11-18 10:22:55 +01:00
parent b48432f541
commit cf6591ace1
No known key found for this signature in database

View File

@ -296,9 +296,7 @@ func (mms *MqttMonitor) onConnectionLost(_ mqtt.Client, err error) {
Log("connection lost: " + err.Error()) Log("connection lost: " + err.Error())
// Handle connection loss here (e.g., reconnect attempts, logging) // Handle connection loss here (e.g., reconnect attempts, logging)
if !mms.IsTerminated() { if !mms.IsTerminated() {
mms.lostConnectionMutex.Lock() mms.setConnectionStatus(true)
mms.lostConnection = true
mms.lostConnectionMutex.Unlock()
} }
} }