using the defined function (#476)

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2024-11-18 10:26:19 +01:00 committed by GitHub
parent b48432f541
commit ae086b9b37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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()
} }
} }