Skip to content

Commit

Permalink
elevenlabs: fix send_task not closing properly (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Aug 7, 2024
1 parent e167424 commit 58c9e3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-comics-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-elevenlabs": patch
---

elevenlabs: fix send_task not closing properly
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,15 @@ async def recv_task():
segment_id=segment_id,
)

await asyncio.gather(send_task(), recv_task())
tasks = [
asyncio.create_task(send_task()),
asyncio.create_task(recv_task()),
]

try:
await asyncio.gather(*tasks)
finally:
await utils.aio.gracefully_cancel(*tasks)

def _process_stream_event(
self, *, data: dict, request_id: str, segment_id: str
Expand Down

0 comments on commit 58c9e3e

Please sign in to comment.