mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
avoid reconnect timer being disrupted by possible SNTP updates
This commit is contained in:
1 parent
5b39c93478
commit
b6560306ba
1 file changed
+1
-1
@@ -120,7 +120,7 @@ void mg_mqtt_poll(struct mg_mgr *mgr) {
|
|||||||
|
|
||||||
// Reconnect if connection is closed, and send MQTT PINGs to keep
|
// Reconnect if connection is closed, and send MQTT PINGs to keep
|
||||||
// the connection alive or to detect connection loss
|
// the connection alive or to detect connection loss
|
||||||
if (mg_timer_expired(&timer, MQTT_RECONNECT_PERIOD_MS, mg_now())) {
|
if (mg_timer_expired(&timer, MQTT_RECONNECT_PERIOD_MS, mg_millis())) {
|
||||||
if (s_mqtt_conn == NULL) {
|
if (s_mqtt_conn == NULL) {
|
||||||
struct mg_mqtt_opts opts = {
|
struct mg_mqtt_opts opts = {
|
||||||
.clean = true,
|
.clean = true,
|
||||||
|
|||||||
Reference in new issue
Block a user