Skip to content

Commit a151dc8

Browse files
authored
Merge pull request #607 from opsmill/develop
Merge develop into infrahub-develop
2 parents 9fb8d3c + 89426c6 commit a151dc8

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
@@ -327,7 +327,6 @@ def _initialize(self) -> None:
327327
self.object_store = ObjectStore(self)
328328
self.store = NodeStore(default_branch=self.default_branch)
329329
self.task = InfrahubTaskManager(self)
330-
self.concurrent_execution_limit = asyncio.Semaphore(self.max_concurrent_execution)
331330
self._request_method: AsyncRequester = self.config.requester or self._default_request_method
332331
self.group_context = InfrahubGroupContext(self)
333332

@@ -1583,8 +1582,7 @@ async def allocate_next_ip_prefix(
15831582

15841583
async def create_batch(self, return_exceptions: bool = False) -> InfrahubBatch:
15851584
return InfrahubBatch(
1586-
semaphore=self.concurrent_execution_limit,
1587-
return_exceptions=return_exceptions,
1585+
max_concurrent_execution=self.max_concurrent_execution, return_exceptions=return_exceptions
15881586
)
15891587

15901588
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)