Skip to content

Commit 435b390

Browse files
Timeout agent if no ensembles to run
1 parent c01defe commit 435b390

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

joshua/joshua_agent.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,14 +748,9 @@ def agent(
748748
ensembles_can_run = list(
749749
filter(joshua_model.should_run_ensemble, ensembles)
750750
)
751-
if not ensembles_can_run:
752-
# All the ensembles have enough runs started for now. Don't
753-
# time the agent out, just wait until there are no
754-
# ensembles or the other agents might have died.
755-
time.sleep(1)
756-
continue
757-
else:
758-
# No ensembles at all. Consider timing this agent out.
751+
752+
if not ensembles or (ensembles and not ensembles_can_run):
753+
# No ensembles to run. Consider timing this agent out.
759754
try:
760755
watch.wait_for_any(watch, sanity_watch, TimeoutFuture(1.0))
761756
except Exception as e:

0 commit comments

Comments
 (0)