mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-11-21 03:28:57 +08:00
fix: stop MQTT internal loop immediately when main loop is closed (#1484)
This commit is contained in:
@@ -589,6 +589,13 @@ class _MipsClient(ABC):
|
||||
|
||||
def __mqtt_loop_handler(self) -> None:
|
||||
try:
|
||||
# If the main loop is closed, stop the internal loop immediately
|
||||
if self.main_loop.is_closed():
|
||||
self.log_debug(
|
||||
'The main loop is closed, stop the internal loop.')
|
||||
if not self._internal_loop.is_closed():
|
||||
self._internal_loop.stop()
|
||||
return
|
||||
if self._mqtt:
|
||||
self._mqtt.loop_read()
|
||||
if self._mqtt:
|
||||
|
||||
Reference in New Issue
Block a user