mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
feat: skip cancel monitor task
This commit is contained in:
parent
ca7553b607
commit
91d33083da
1 changed files with 10 additions and 9 deletions
|
|
@ -438,15 +438,16 @@ class TTSProvider(TTSProviderBase):
|
||||||
finally:
|
finally:
|
||||||
self.ws = None
|
self.ws = None
|
||||||
|
|
||||||
if self._monitor_task and not self._monitor_task.done():
|
if not skip_cancel_monitor_task:
|
||||||
try:
|
if self._monitor_task and not self._monitor_task.done():
|
||||||
await self._monitor_task
|
try:
|
||||||
except asyncio.CancelledError:
|
await self._monitor_task
|
||||||
pass
|
except asyncio.CancelledError:
|
||||||
except Exception as e:
|
pass
|
||||||
logger.bind(tag=TAG).warning(f"Error canceling monitor task: {e}")
|
except Exception as e:
|
||||||
finally:
|
logger.bind(tag=TAG).warning(f"Error canceling monitor task: {e}")
|
||||||
self._monitor_task = None
|
finally:
|
||||||
|
self._monitor_task = None
|
||||||
|
|
||||||
async def _monitor_ws_response(self):
|
async def _monitor_ws_response(self):
|
||||||
"""Monitor WebSocket responses - long running task (MessagePack serialization)"""
|
"""Monitor WebSocket responses - long running task (MessagePack serialization)"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue