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 @@ -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 (
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