mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
dont queue mqtt if not connected, dev.4e
This commit is contained in:
@@ -472,6 +472,7 @@ void Mqtt::on_disconnect(espMqttClientTypes::DisconnectReason reason) {
|
|||||||
} else {
|
} else {
|
||||||
LOG_WARNING("MQTT disconnected: code %d", reason);
|
LOG_WARNING("MQTT disconnected: code %d", reason);
|
||||||
}
|
}
|
||||||
|
mqttClient_->clearQueue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MQTT on_connect - when an MQTT connect is established
|
// MQTT on_connect - when an MQTT connect is established
|
||||||
@@ -589,7 +590,7 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!mqtt_enabled_ || topic.empty()) {
|
if (!mqtt_enabled_ || topic.empty() || !connected()) {
|
||||||
return false; // quit, not using MQTT
|
return false; // quit, not using MQTT
|
||||||
}
|
}
|
||||||
// check free mem
|
// check free mem
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define EMSESP_APP_VERSION "3.6.3-dev.4d"
|
#define EMSESP_APP_VERSION "3.6.3-dev.4e"
|
||||||
|
|||||||
Reference in New Issue
Block a user