From 4759fdadef5915321cc16c4e26c392d203866092 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Thu, 19 Oct 2023 16:24:15 -0400 Subject: [PATCH] Use proper addTimer call --- src/mqtt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 7c5ec4166..e03cca2f3 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -375,11 +375,11 @@ void MosquittoClient::HandleConnect() { } void MosquittoClient::HandleDisconnect() { - LogWarn(VB_CONTROL, "Mosquitto Disconnected. Will try reconnect\n"); + long long tm = GetTimeMS(); + LogWarn(VB_CONTROL, "Mosquitto Disconnected. Will try reconnect %ld\n", tm); m_isConnected = false; - Timers::INSTANCE.addTimer("MosquittoDisconnect", 15000, [this]() { + Timers::INSTANCE.addTimer("MosquittoDisconnect", tm + 10000, [this, tm]() { if (!m_isConnected) { - LogWarn(VB_CONTROL, "Mosquitto Disconnected. Reconnect failed.\n"); WarningHolder::AddWarning("MQTT Disconnected"); } });