Skip to content

Commit

Permalink
Fix: Solved logic PR issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres D. Molins committed Jan 24, 2024
1 parent 012bca1 commit 05e6938
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/aleph_vrf/coordinator/executor_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,11 @@ async def select_executors(self, nb_executors: int) -> List[Executor]:

compute_nodes = self._list_compute_nodes()
blacklisted_nodes = self._get_unauthorized_nodes()
whitelisted_nodes = (
node
async for node in compute_nodes
if node.address not in blacklisted_nodes
)

executors = [
AlephExecutor(node=node, vm_function=self.vm_function)
async for node in whitelisted_nodes
async for node in compute_nodes
if node.address not in blacklisted_nodes
]

if len(executors) < nb_executors:
Expand All @@ -122,14 +119,10 @@ async def select_executors(self, nb_executors: int) -> List[Executor]:
async def get_candidate_executors(self) -> List[Executor]:
compute_nodes = self._list_compute_nodes()
blacklisted_nodes = self._get_unauthorized_nodes()
whitelisted_nodes = (
node
async for node in compute_nodes
if node.address not in blacklisted_nodes
)
executors = [
AlephExecutor(node=node, vm_function=self.vm_function)
async for node in whitelisted_nodes
async for node in compute_nodes
if node.address not in blacklisted_nodes
]

return executors
Expand Down

0 comments on commit 05e6938

Please sign in to comment.