Skip to content

Commit cc65653

Browse files
committed
Another false error
1 parent c8afb4a commit cc65653

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

internal-packages/run-engine/src/engine/systems/dequeueSystem.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { PrismaClientOrTransaction } from "@trigger.dev/database";
88
import { getRunWithBackgroundWorkerTasks } from "../db/worker.js";
99
import { sendNotificationToWorker } from "../eventBus.js";
1010
import { getMachinePreset } from "../machinePresets.js";
11-
import { isDequeueableExecutionStatus } from "../statuses.js";
11+
import { isDequeueableExecutionStatus, isExecuting } from "../statuses.js";
1212
import { RunEngineOptions } from "../types.js";
1313
import { ExecutionSnapshotSystem, getLatestExecutionSnapshot } from "./executionSnapshotSystem.js";
1414
import { RunAttemptSystem } from "./runAttemptSystem.js";
@@ -132,9 +132,16 @@ export class DequeueSystem {
132132
},
133133
tx: prisma,
134134
});
135-
this.$.logger.error(
136-
`RunEngine.dequeueFromWorkerQueue(): Run is not in a valid state to be dequeued: ${runId}\n ${snapshot.id}:${snapshot.executionStatus}`
137-
);
135+
136+
if (isExecuting(snapshot.executionStatus)) {
137+
this.$.logger.error(
138+
`RunEngine.dequeueFromWorkerQueue(): Run is not in a valid state to be dequeued: ${runId}\n ${snapshot.id}:${snapshot.executionStatus}`
139+
);
140+
} else {
141+
this.$.logger.warn(
142+
`RunEngine.dequeueFromWorkerQueue(): Run is in an expected not valid state to be dequeued: ${runId}\n ${snapshot.id}:${snapshot.executionStatus}`
143+
);
144+
}
138145

139146
return;
140147
}

0 commit comments

Comments
 (0)