File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff line change 44from collections .abc import Iterable
55from typing import TYPE_CHECKING , Any
66
7- from ..batch import InfrahubBatch
87from ..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 (
You can’t perform that action at this time.
0 commit comments