fix: preserve queue blocked state
This commit is contained in:
@@ -82,14 +82,20 @@ function assertDispatchable(task: QueueTaskRecord): void {
|
||||
}
|
||||
|
||||
function queueStateFromCore(run: RunRecord, command: CommandRecord): QueueTaskState {
|
||||
const runState = queueTerminalStateFromRun(run);
|
||||
if (runState) return runState;
|
||||
if (command.state === "completed") return "completed";
|
||||
if (command.state === "failed") return "failed";
|
||||
if (command.state === "cancelled") return "cancelled";
|
||||
return "running";
|
||||
}
|
||||
|
||||
function queueTerminalStateFromRun(run: RunRecord): QueueTaskState | null {
|
||||
if (run.status === "completed") return "completed";
|
||||
if (run.status === "failed") return "failed";
|
||||
if (run.status === "blocked") return "blocked";
|
||||
if (run.status === "cancelled") return "cancelled";
|
||||
return "running";
|
||||
return null;
|
||||
}
|
||||
|
||||
function buildRunInput(task: QueueTaskRecord, input: JsonRecord): CreateRunInput {
|
||||
|
||||
Reference in New Issue
Block a user