Skip to content

Commit 8ed01ce

Browse files
fix: make IndexSearch optimization log reasons why it may refuse to u… (#524)
* fix: make IndexSearch optimization log reasons why it may refuse to use a replacement task * style: pre-commit.ci auto fixes [...] --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cbc9fa5 commit 8ed01ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/taskgraph/optimize/strategies.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ def should_replace_task(self, task, params, deadline, arg):
4949
# status can be `None` if we're in `testing` mode
5050
# (e.g. test-action-callback)
5151
if not status or status.get("state") in ("exception", "failed"):
52+
logger.debug(
53+
f'not replacing {task["label"]} with {task_id} because it is in failed or exception state'
54+
)
5255
continue
5356

5457
if deadline and datetime.strptime(
5558
status["expires"], self.fmt
5659
) < datetime.strptime(deadline, self.fmt):
60+
logger.debug(
61+
f'not replacing {task["label"]} with {task_id} because it expires before {deadline}'
62+
)
5763
continue
5864

5965
return task_id

0 commit comments

Comments
 (0)