Skip to content

Commit

Permalink
gather tasks even if they are cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Nov 15, 2024
1 parent 723a670 commit d183b22
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions aggrec/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ async def lifespan(app: "AggrecServer"):
yield
for task in tasks:
task.cancel()
await asyncio.gather(*tasks, return_exceptions=True)
logger.debug("All background tasks cancelled")
app.logger.debug("Lifespan ended")

Expand Down

0 comments on commit d183b22

Please sign in to comment.