mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +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:
@@ -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