Skip to content

Commit 272a6ef

Browse files
committed
fix(cron): keep skipped tasks failed
1 parent 891d2d9 commit 272a6ef

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/cron/service/task-runs.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe("cron task run terminal records", () => {
164164
tryFinishCronTaskRunWithoutHistory(state, {
165165
taskRunId: runIds[0],
166166
status: "skipped",
167-
error: "cron run skipped before execution",
167+
error: "cron: job execution timed out",
168168
endedAt: 1_501,
169169
});
170170
expect(childSessionKey(systemEventJob)).toBeUndefined();
@@ -176,7 +176,7 @@ describe("cron task run terminal records", () => {
176176
).toEqual([
177177
expect.objectContaining({
178178
status: "failed",
179-
error: "cron run skipped before execution",
179+
error: "cron: job execution timed out",
180180
}),
181181
]);
182182
},
@@ -441,7 +441,7 @@ describe("cron task run terminal records", () => {
441441
action: "finished",
442442
job,
443443
status: "skipped",
444-
error: "trigger condition not met",
444+
error: "cron: job execution timed out",
445445
runId: "manual:skipped-job:1",
446446
runAtMs: startedAt,
447447
durationMs: 0,
@@ -461,7 +461,7 @@ describe("cron task run terminal records", () => {
461461
status: "failed",
462462
startedAt,
463463
endedAt: startedAt,
464-
error: "trigger condition not met",
464+
error: "cron: job execution timed out",
465465
detail: {
466466
kind: "cron-run",
467467
status: "skipped",

‎src/cron/task-run-detail.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export function cronRunStatusToTaskStatus(
267267
if (entry.status === "ok") {
268268
return "succeeded";
269269
}
270-
return isCronTimeoutErrorText(entry.error) ? "timed_out" : "failed";
270+
return entry.status === "error" && isCronTimeoutErrorText(entry.error) ? "timed_out" : "failed";
271271
}
272272

273273
/** Reconstructs the unchanged CronRunLogEntry wire shape from a cron task row. */

0 commit comments

Comments
 (0)