Skip to content

Commit

Permalink
Terminate AsyncLLMEngine task gracefully (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskiran1 authored Oct 12, 2023
1 parent 27a07d3 commit ab5a811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ async def await_shutdown(self):
)
await asyncio.sleep(5)

for task in asyncio.all_tasks(loop=self._loop):
if task is not asyncio.current_task():
task.cancel()

self.logger.log_info("Shutdown complete")

def get_sampling_params_dict(self, params_json):
Expand Down

0 comments on commit ab5a811

Please sign in to comment.