Skip to content

Commit

Permalink
fix issue with dependency resolution that generates loops
Browse files Browse the repository at this point in the history
  • Loading branch information
livioribeiro committed Mar 29, 2024
1 parent 5747bbd commit 09583d1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/selva/di/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ async def _get(
async def _get_dependent_services(
self, service_spec: ServiceSpec, stack: list
) -> dict[str, Any]:
deps = await asyncio.gather(
*[self._get(d, stack) for _, d in service_spec.dependencies]
)
names = [n for n, _ in service_spec.dependencies]
return dict(zip(names, deps))
return {
name: await self._get(dep, stack)
for name, dep in service_spec.dependencies
}

async def _create_service(
self,
Expand Down

0 comments on commit 09583d1

Please sign in to comment.