mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-24 10:49:21 -04:00
♻️ Create dependency-cache dict in solve_dependencies only if None (don't re-create if empty) (#13689)
This commit is contained in:
1 parent
21aa9d3719
commit
c2c6049b8f
1 file changed
+2
-2
@@ -593,7 +593,8 @@ async def solve_dependencies(
|
||||
response = Response()
|
||||
del response.headers["content-length"]
|
||||
response.status_code = None # type: ignore
|
||||
dependency_cache = dependency_cache or {}
|
||||
if dependency_cache is None:
|
||||
dependency_cache = {}
|
||||
sub_dependant: Dependant
|
||||
for sub_dependant in dependant.dependencies:
|
||||
sub_dependant.call = cast(Callable[..., Any], sub_dependant.call)
|
||||
@@ -630,7 +631,6 @@ async def solve_dependencies(
|
||||
embed_body_fields=embed_body_fields,
|
||||
)
|
||||
background_tasks = solved_result.background_tasks
|
||||
dependency_cache.update(solved_result.dependency_cache)
|
||||
if solved_result.errors:
|
||||
errors.extend(solved_result.errors)
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user