break once ConnectionClosed error

This commit is contained in:
Vaibhav159
2025-02-10 23:04:05 +05:30
parent b06b16adb7
commit 2c62d3bf32
2 changed files with 2 additions and 0 deletions

View File

@@ -392,6 +392,7 @@ class ElevenLabsTTSService(WordTTSService, WebsocketService):
await self._send_text("")
except websockets.ConnectionClosed as e:
logger.warning(f"{self} keepalive error: {e}")
break
async def _send_text(self, text: str):
if self._websocket:

View File

@@ -87,6 +87,7 @@ class WebsocketService(ABC):
retry_count = 0 # Reset counter on successful message receive
except websockets.ConnectionClosed as e:
logger.warning(f"{self} connection closed: {e}")
break
except Exception as e:
retry_count += 1
if retry_count >= MAX_RETRIES: