Skip to content

Commit 89426c6

Browse files
authored
Merge pull request #605 from opsmill/fac-merge-stable-into-develop
Merge stable into develop
2 parents b52cd94 + 7b0e10d commit 89426c6

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

infrahub_sdk/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ def _initialize(self) -> None:
343343
self.object_store = ObjectStore(self)
344344
self.store = NodeStore(default_branch=self.default_branch)
345345
self.task = InfrahubTaskManager(self)
346-
self.concurrent_execution_limit = asyncio.Semaphore(self.max_concurrent_execution)
347346
self._request_method: AsyncRequester = self.config.requester or self._default_request_method
348347
self.group_context = InfrahubGroupContext(self)
349348

@@ -1599,8 +1598,7 @@ async def allocate_next_ip_prefix(
15991598

16001599
async def create_batch(self, return_exceptions: bool = False) -> InfrahubBatch:
16011600
return InfrahubBatch(
1602-
semaphore=self.concurrent_execution_limit,
1603-
return_exceptions=return_exceptions,
1601+
max_concurrent_execution=self.max_concurrent_execution, return_exceptions=return_exceptions
16041602
)
16051603

16061604
async def get_list_repositories(

infrahub_sdk/node/relationship.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from collections.abc import Iterable
55
from typing import TYPE_CHECKING, Any
66

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

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

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

0 commit comments

Comments
 (0)