Skip to content
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
6 changes: 6 additions & 0 deletions src/taskgraph/optimize/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ def should_replace_task(self, task, params, deadline, arg):
# status can be `None` if we're in `testing` mode
# (e.g. test-action-callback)
if not status or status.get("state") in ("exception", "failed"):
logger.debug(
f'not replacing {task["label"]} with {task_id} because it is in failed or exception state'
)
continue

if deadline and datetime.strptime(
status["expires"], self.fmt
) < datetime.strptime(deadline, self.fmt):
logger.debug(
f'not replacing {task["label"]} with {task_id} because it expires before {deadline}'
)
continue

return task_id
Expand Down