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 23, 2024
1 parent fc3aa83 commit 23b120e
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 23b120e

Please sign in to comment.