Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/dishka/code_tools/factory_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,12 @@ def compile_factory(
compiled_deps: dict[DependencyKey, CompiledFactory],
container_key: DependencyKey,
) -> CompiledFactory:
if factory.type is FactoryType.ALIAS and factory.source in compiled_deps:
return compiled_deps[factory.source]
if (
factory.type is FactoryType.ALIAS
and factory.dependencies[0] in compiled_deps
and not factory.cache
):
return compiled_deps[factory.dependencies[0]]

if not is_async and factory.type in ASYNC_TYPES:
raise UnsupportedFactoryError(factory)
Expand Down
Loading