Fix an issue where GoogleSTTService would timeout due to stream inactivity
This commit is contained in:
@@ -1972,7 +1972,8 @@ class GoogleSTTService(STTService):
|
||||
break
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Stream error, attempting to reconnect: {e}")
|
||||
logger.warning(f"{self} Reconnecting: {e}")
|
||||
|
||||
await asyncio.sleep(1) # Brief delay before reconnecting
|
||||
self._stream_start_time = int(time.time() * 1000)
|
||||
continue
|
||||
@@ -2025,3 +2026,6 @@ class GoogleSTTService(STTService):
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error processing Google STT responses: {e}")
|
||||
|
||||
# Re-raise the exception to let it propagate (e.g. in the case of a timeout, propagate to _stream_audio to reconnect)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user