Skip to content

Commit

Permalink
Fix redundant pushings (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin authored Nov 13, 2024
2 parents 0398b3b + ca799ab commit 54a409d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/routers/transcribe_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def transcript_consume():
nonlocal transcript_ws
while websocket_active or len(segment_buffers) > 0:
await asyncio.sleep(1)
if transcript_ws:
if transcript_ws and len(segment_buffers) > 0:
try:
# 100|data
data = bytearray()
Expand Down Expand Up @@ -346,7 +346,7 @@ async def audio_bytes_consume():
nonlocal audio_bytes_ws
while websocket_active or len(audio_buffers) > 0:
await asyncio.sleep(1)
if audio_bytes_ws:
if audio_bytes_ws and len(audio_buffers) > 0:
try:
# 101|data
data = bytearray()
Expand Down

0 comments on commit 54a409d

Please sign in to comment.