Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jiachin1995 authored Mar 25, 2024
1 parent 0053dc1 commit 7a0d184
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4418,8 +4418,10 @@ def _handle_on_connect_fail(self) -> None:
MQTT_LOG_ERR, 'Caught exception in on_connect_fail: %s', err)

def _thread_main(self) -> None:
self.loop_forever(retry_first_connection=True)
self._thread = None
try:
self.loop_forever(retry_first_connection=True)
finally:
self._thread = None

def _reconnect_wait(self) -> None:
# See reconnect_delay_set for details
Expand Down

0 comments on commit 7a0d184

Please sign in to comment.