File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ async def __run_loop(self) -> None:
7777 reconnect_interval = 5
7878 while True :
7979 try :
80+ LOG .debug (
81+ "Connecting to %s:%s as %s" ,
82+ self .host ,
83+ self .port ,
84+ self .publisher_id ,
85+ )
8086 async with client :
8187 self .__connected .set ()
8288 await self .__on_connect ()
@@ -88,17 +94,19 @@ async def __run_loop(self) -> None:
8894 message .qos ,
8995 message .properties ,
9096 )
91- except aiomqtt .MqttError as e :
97+ except aiomqtt .MqttError :
9298 LOG .error (
93- f"Connection to MQTT broker lost; Reconnecting in { reconnect_interval } seconds ...: { e } "
99+ "Connection to %s:%s lost; Reconnecting in %d seconds ..." ,
100+ self .host ,
101+ self .port ,
102+ reconnect_interval ,
94103 )
95104 await asyncio .sleep (reconnect_interval )
96105 except asyncio .exceptions .CancelledError :
97106 LOG .debug ("MQTT publisher loop cancelled" )
98107 raise
99108 finally :
100109 self .__connected .clear ()
101- self .client = None
102110 LOG .info ("MQTT client disconnected" )
103111
104112 @override
You can’t perform that action at this time.
0 commit comments