Skip to content

Commit

Permalink
Remove incorrect use of async for
Browse files Browse the repository at this point in the history
  • Loading branch information
anjz committed Mar 26, 2024
1 parent cbd61de commit 58d87f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stream_transcriber/streams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions, variables and classes for handling the transcription streams
"""

import asyncio
import logging
import subprocess
Expand Down Expand Up @@ -248,14 +249,14 @@ async def load_stream(stream_name: str):
[log_task, send_audio_task, asr_task, stream_clone_task],
return_when=asyncio.FIRST_EXCEPTION,
)
async for done_routine in done:
for done_routine in done:
if done_routine.exception() is not None:
LOGGER.error(
"Exception in return %s",
done_routine.exception(),
extra={"stream": stream_name},
)
async for pending_routine in pending:
for pending_routine in pending:
pending_routine.cancel()
if pending_routine.exception() is not None:
LOGGER.error(
Expand Down

0 comments on commit 58d87f2

Please sign in to comment.