Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions infrahub_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def _initialize(self) -> None:
self.object_store = ObjectStore(self)
self.store = NodeStore(default_branch=self.default_branch)
self.task = InfrahubTaskManager(self)
self.concurrent_execution_limit = asyncio.Semaphore(self.max_concurrent_execution)
self._request_method: AsyncRequester = self.config.requester or self._default_request_method
self.group_context = InfrahubGroupContext(self)

Expand Down Expand Up @@ -1599,8 +1598,7 @@ async def allocate_next_ip_prefix(

async def create_batch(self, return_exceptions: bool = False) -> InfrahubBatch:
return InfrahubBatch(
semaphore=self.concurrent_execution_limit,
return_exceptions=return_exceptions,
max_concurrent_execution=self.max_concurrent_execution, return_exceptions=return_exceptions
)

async def get_list_repositories(
Expand Down
4 changes: 1 addition & 3 deletions infrahub_sdk/node/relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any

from ..batch import InfrahubBatch
from ..exceptions import (
Error,
UninitializedError,
Expand Down Expand Up @@ -166,7 +165,7 @@ async def fetch(self) -> None:
raise Error("Unable to fetch the peer, id and/or typename are not defined")
ids_per_kind_map[peer.typename].append(peer.id)

batch = InfrahubBatch(max_concurrent_execution=self.client.max_concurrent_execution)
batch = await self.client.create_batch()
for kind, ids in ids_per_kind_map.items():
batch.add(
task=self.client.filters,
Expand Down Expand Up @@ -289,7 +288,6 @@ def fetch(self) -> None:
raise Error("Unable to fetch the peer, id and/or typename are not defined")
ids_per_kind_map[peer.typename].append(peer.id)

# Unlike Async, no need to create a new batch from scratch because we are not using a semaphore
batch = self.client.create_batch()
for kind, ids in ids_per_kind_map.items():
batch.add(
Expand Down