mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-10-30 19:51:59 +01:00
fix: MQTT schedule the reconnect timer before calling disconnect(), so by the time _on_broker_disconnected fires, the pending reconnect is already visible.
This commit is contained in:
1 parent
7fcad04f49
commit
d82c90a04d
1 file changed
+2
-1
@@ -322,8 +322,9 @@ class _BrokerConnection:
|
||||
logger.info(f"JWT token expiring soon for {self.broker['name']}, refreshing...")
|
||||
self._running = False
|
||||
self._jwt_refresh_timer = None
|
||||
self.client.disconnect() # Triggers clean disconnect, then reconnect via timer
|
||||
|
||||
self._schedule_reconnect(reason="JWT token expiry")
|
||||
self.client.disconnect()
|
||||
|
||||
|
||||
# ====================================================================
|
||||
|
||||
Reference in new issue
Block a user