mirror of https://github.com/tiangolo/fastapi.git
🐛 Check async generator before regular generator to execute that first, as that's the special case
This commit is contained in:
parent
ce8baaeda3
commit
230c550220
|
|
@ -548,10 +548,10 @@ async def _solve_generator(
|
|||
*, dependant: Dependant, stack: AsyncExitStack, sub_values: Dict[str, Any]
|
||||
) -> Any:
|
||||
assert dependant.call
|
||||
if dependant.is_gen_callable:
|
||||
cm = contextmanager_in_threadpool(contextmanager(dependant.call)(**sub_values))
|
||||
elif dependant.is_async_gen_callable:
|
||||
if dependant.is_async_gen_callable:
|
||||
cm = asynccontextmanager(dependant.call)(**sub_values)
|
||||
elif dependant.is_gen_callable:
|
||||
cm = contextmanager_in_threadpool(contextmanager(dependant.call)(**sub_values))
|
||||
return await stack.enter_async_context(cm)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue