Skip to content

Commit c766da5

Browse files
authored
Merge pull request #27 from megalaren/fix-starlette-1.0-compat
fix: remove startup/shutdown calls incompatible with Starlette 1.0
2 parents 7e35a08 + ce96e59 commit c766da5

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
"Development Status :: 3 - Alpha",
2424
]
2525
keywords = ["taskiq", "tasks", "distributed", "async", "fastapi"]
26-
dependencies = ["taskiq>=0.8.0", "fastapi>=0.93.0"]
26+
dependencies = ["taskiq>=0.8.0", "fastapi>=0.133.0,<1"]
2727

2828
[dependency-groups]
2929
dev = [

taskiq_fastapi/initializator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ async def startup(state: TaskiqState) -> None:
4141
raise ValueError(f"'{app_or_path}' is not a FastAPI application.")
4242

4343
state.fastapi_app = app
44-
await app.router.startup()
4544
state.lf_ctx = app.router.lifespan_context(app)
4645
asgi_state = await state.lf_ctx.__aenter__()
4746
populate_dependency_context(broker, app, asgi_state)
@@ -65,7 +64,6 @@ def shutdown_event_generator(
6564
async def shutdown(state: TaskiqState) -> None:
6665
if not broker.is_worker_process:
6766
return
68-
await state.fastapi_app.router.shutdown()
6967
await state.lf_ctx.__aexit__(None, None, None)
7068

7169
return shutdown

0 commit comments

Comments
 (0)