Skip to content

Commit 986c0ce

Browse files
Wait for graceful shutdown
1 parent 882aad9 commit 986c0ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/replit_river/v2/session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ async def close(self) -> None:
421421
# ... message processor so it can exit cleanly
422422
self._process_messages.set()
423423

424+
# Wait a tick to permit the waiting tasks to shut down gracefully
425+
await asyncio.sleep(0.01)
426+
424427
await self._task_manager.cancel_all_tasks()
425428

426429
# TODO: unexpected_close should close stream differently here to

0 commit comments

Comments
 (0)