Skip to content

Commit c1b9537

Browse files
fix: lifespan
1 parent c7d8691 commit c1b9537

File tree

1 file changed

+3
-7
lines changed
  • packages/service-library/src/servicelib/fastapi/celery

1 file changed

+3
-7
lines changed

packages/service-library/src/servicelib/fastapi/celery/app_server.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import datetime
32
import logging
43
import threading
@@ -25,9 +24,6 @@ async def lifespan(self, startup_completed_event: threading.Event) -> None:
2524
startup_timeout=None, # waits for full app initialization (DB migrations, etc.)
2625
shutdown_timeout=_SHUTDOWN_TIMEOUT,
2726
):
28-
try:
29-
_logger.info("fastapi app initialized")
30-
startup_completed_event.set()
31-
await self.shutdown_event.wait() # NOTE: wait here until shutdown is requested
32-
except asyncio.CancelledError:
33-
_logger.warning("lifespan task cancelled")
27+
_logger.info("fastapi app initialized")
28+
startup_completed_event.set()
29+
await self.shutdown_event.wait() # NOTE: wait here until shutdown is requested

0 commit comments

Comments
 (0)