Skip to content

Commit d7d7a3e

Browse files
tests: fix
1 parent b791440 commit d7d7a3e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
class FastAPIAppServer(BaseAppServer[FastAPI]):
1414
def __init__(self, app: FastAPI):
1515
super().__init__(app)
16+
self._lifespan_manager: LifespanManager | None = None
17+
18+
async def on_startup(self) -> None:
1619
self._lifespan_manager = LifespanManager(
17-
app,
20+
self.app,
1821
startup_timeout=_STARTUP_TIMEOUT,
1922
shutdown_timeout=_SHUTDOWN_TIMEOUT,
2023
)
21-
22-
async def on_startup(self) -> None:
2324
await self._lifespan_manager.__aenter__()
2425

2526
async def on_shutdown(self) -> None:

packages/service-library/src/servicelib/queued_tasks/app_server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
STARTUP_TIMEOUT: Final[float] = datetime.timedelta(minutes=1).total_seconds()
1111

12-
AppType = TypeVar("AppType")
12+
T = TypeVar("T")
1313

1414

15-
class BaseAppServer(ABC, Generic[AppType]):
16-
def __init__(self, app: AppType) -> None:
17-
self._app: AppType = app
15+
class BaseAppServer(ABC, Generic[T]):
16+
def __init__(self, app: T) -> None:
17+
self._app: T = app
1818
self._shutdown_event: asyncio.Event | None = None
1919

2020
@property
21-
def app(self) -> AppType:
21+
def app(self) -> T:
2222
return self._app
2323

2424
@property

0 commit comments

Comments
 (0)