Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexus empty fork fix #132

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions esd_services_api_client/nexus/algorithms/forked_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ async def _measured_run(**run_args) -> AlgorithmResult:
self._get_forks, **self._inputs, **kwargs
)()

if len(forks) > 0:
self._logger.info(
"Forking node with: {forks}, after the node run",
forks=",".join([fork.alias() for fork in forks]),
)
else:
self._logger.info("Leaf algorithm node: proceeding with this node run only")

run_result = await partial(
_measured_run,
**kwargs,
Expand All @@ -170,7 +162,15 @@ async def _measured_run(**run_args) -> AlgorithmResult:
logger=self._logger,
)()

# now await callback scheduling
await asyncio.wait([asyncio.create_task(fork.run(**kwargs)) for fork in forks])
if len(forks) > 0:
self._logger.info(
"Forking node with: {forks}, after the node run",
forks=",".join([fork.alias() for fork in forks]),
)
await asyncio.wait(
[asyncio.create_task(fork.run(**kwargs)) for fork in forks]
)
else:
self._logger.info("Leaf algorithm node: proceeding with this node run only")

return run_result