pre-commit-ci-lite[bot]
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
5 deletions
-
fastapi/routing.py
-
tests/test_background_tasks_merge.py
|
|
|
@ -61,9 +61,9 @@ from fastapi.utils import ( |
|
|
|
is_body_allowed_for_status_code, |
|
|
|
) |
|
|
|
from starlette import routing |
|
|
|
from starlette.background import BackgroundTasks as StarletteBackgroundTasks |
|
|
|
from starlette._exception_handler import wrap_app_handling_exceptions |
|
|
|
from starlette._utils import is_async_callable |
|
|
|
from starlette.background import BackgroundTasks as StarletteBackgroundTasks |
|
|
|
from starlette.concurrency import run_in_threadpool |
|
|
|
from starlette.exceptions import HTTPException |
|
|
|
from starlette.requests import Request |
|
|
|
@ -446,9 +446,7 @@ def get_request_handler( |
|
|
|
merged.tasks.extend(existing.tasks) |
|
|
|
else: |
|
|
|
merged.tasks.append(existing) |
|
|
|
merged.tasks.extend( |
|
|
|
solved_result.background_tasks.tasks |
|
|
|
) |
|
|
|
merged.tasks.extend(solved_result.background_tasks.tasks) |
|
|
|
raw_response.background = merged |
|
|
|
response = raw_response |
|
|
|
else: |
|
|
|
|
|
|
|
@ -3,7 +3,6 @@ from fastapi.testclient import TestClient |
|
|
|
from starlette.background import BackgroundTask |
|
|
|
from starlette.responses import JSONResponse |
|
|
|
|
|
|
|
|
|
|
|
results: list[str] = [] |
|
|
|
|
|
|
|
|
|
|
|
|