Skip to content

Commit

Permalink
Don't need to cancel when terminating the process, the task should en…
Browse files Browse the repository at this point in the history
…d on its own
  • Loading branch information
Acly committed Oct 14, 2024
1 parent 8c16547 commit b39458e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai_diffusion/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ async def stop(self):
if self._process and self._task:
log.info("Stopping server")
self._process.terminate()
self._task.cancel()
await asyncio.wait_for(self._task, timeout=5)
except asyncio.CancelledError:
pass
except asyncio.TimeoutError:
log.warning("Server did not terminate in time")
pass

def terminate(self):
try:
Expand Down

0 comments on commit b39458e

Please sign in to comment.