fix(runtime): guard cleanup and preserve skipped cron jobs

This commit is contained in:
Sebastian
2026-02-12 09:28:47 -05:00
parent 4f329f923c
commit d31caa81ef
3 changed files with 7 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ function moveToFinished(session: ProcessSession, status: ProcessStatus) {
session.child.stderr?.destroy?.();
// Remove all event listeners to prevent memory leaks
session.child.removeAllListeners();
session.child.removeAllListeners?.();
// Clear the reference
delete session.child;

View File

@@ -70,9 +70,7 @@ function applyJobResult(
}
const shouldDelete =
job.schedule.kind === "at" &&
job.deleteAfterRun === true &&
(result.status === "ok" || result.status === "skipped");
job.schedule.kind === "at" && job.deleteAfterRun === true && result.status === "ok";
if (!shouldDelete) {
if (job.schedule.kind === "at") {