Skip to content

Commit

Permalink
run job termination task asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp committed Aug 22, 2024
1 parent 47c00d3 commit 3a4517e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion livekit-agents/livekit/agents/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ async def _recv_task():
elif which == "assignment":
self._handle_assignment(msg.assignment)
elif which == "termination":
await self._handle_termination(msg.termination)
user_task = self._loop.create_task(self._handle_termination(msg.termination), name="termination")
self._tasks.add(user_task)
user_task.add_done_callback(self._tasks.discard)

tasks = [
asyncio.create_task(_load_task()),
Expand Down

0 comments on commit 3a4517e

Please sign in to comment.