Skip to content

Commit 8bce2a8

Browse files
committed
fix(client): do not use shared semaphore for batches
It would make clients hang when using batches within batches. Signed-off-by: Fatih Acar <[email protected]>
1 parent c45b4b8 commit 8bce2a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

infrahub_sdk/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ def _initialize(self) -> None:
303303
self.object_store = ObjectStore(self)
304304
self.store = NodeStore(default_branch=self.default_branch)
305305
self.task = InfrahubTaskManager(self)
306-
self.concurrent_execution_limit = asyncio.Semaphore(self.max_concurrent_execution)
307306
self._request_method: AsyncRequester = self.config.requester or self._default_request_method
308307
self.group_context = InfrahubGroupContext(self)
309308

@@ -1516,7 +1515,9 @@ async def allocate_next_ip_prefix(
15161515
return None
15171516

15181517
async def create_batch(self, return_exceptions: bool = False) -> InfrahubBatch:
1519-
return InfrahubBatch(semaphore=self.concurrent_execution_limit, return_exceptions=return_exceptions)
1518+
return InfrahubBatch(
1519+
max_concurrent_execution=self.max_concurrent_execution, return_exceptions=return_exceptions
1520+
)
15201521

15211522
async def get_list_repositories(
15221523
self, branches: dict[str, BranchData] | None = None, kind: str = "CoreGenericRepository"

0 commit comments

Comments
 (0)