mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-11-22 06:43:58 +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:
|
def __mqtt_loop_handler(self) -> None:
|
||||||
try:
|
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:
|
if self._mqtt:
|
||||||
self._mqtt.loop_read()
|
self._mqtt.loop_read()
|
||||||
if self._mqtt:
|
if self._mqtt:
|
||||||
|
|||||||
Reference in New Issue
Block a user