Track websocket disconnecting status to improve error handling
This commit is contained in:
@@ -141,6 +141,8 @@ class GradiumSTTService(WebsocketSTTService):
|
||||
pass
|
||||
|
||||
async def _connect(self):
|
||||
await super()._connect()
|
||||
|
||||
await self._connect_websocket()
|
||||
|
||||
if self._websocket and not self._receive_task:
|
||||
@@ -179,6 +181,8 @@ class GradiumSTTService(WebsocketSTTService):
|
||||
raise
|
||||
|
||||
async def _disconnect(self):
|
||||
await super()._disconnect()
|
||||
|
||||
if self._receive_task:
|
||||
await self.cancel_task(self._receive_task)
|
||||
self._receive_task = None
|
||||
|
||||
Reference in New Issue
Block a user