show noops in done column, add search bars, remove idle card, fix single-job drain, prevent noop vanish on toggle
Build and Push Docker Image / build (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ function emitQueueStatus(
|
||||
for (const l of jobListeners) l(line);
|
||||
}
|
||||
|
||||
async function runSequential(initial: Job[]): Promise<void> {
|
||||
async function runSequential(initial: Job[], { drain = true } = {}): Promise<void> {
|
||||
if (queueRunning) return;
|
||||
queueRunning = true;
|
||||
queueAbort = new AbortController();
|
||||
@@ -115,8 +115,8 @@ async function runSequential(initial: Job[]): Promise<void> {
|
||||
|
||||
// When the local queue drains, re-check the DB for jobs that were
|
||||
// approved mid-run. Without this they'd sit pending until the user
|
||||
// manually clicks "Run all" again. Skip if aborted — user wants to stop.
|
||||
if (queue.length === 0 && !signal.aborted) {
|
||||
// manually clicks "Run all" again. Skip if aborted or drain=false.
|
||||
if (drain && queue.length === 0 && !signal.aborted) {
|
||||
const more = db.prepare("SELECT * FROM jobs WHERE status = 'pending' ORDER BY created_at").all() as Job[];
|
||||
enqueueUnseenJobs(queue, seen, more);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ app.post("/job/:id/run", async (c) => {
|
||||
if (!result) return c.notFound();
|
||||
return c.json(result);
|
||||
}
|
||||
runSequential([job]).catch((err) => logError(`Job ${job.id} failed:`, err));
|
||||
runSequential([job], { drain: false }).catch((err) => logError(`Job ${job.id} failed:`, err));
|
||||
const result = loadJobRow(jobId);
|
||||
if (!result) return c.notFound();
|
||||
return c.json(result);
|
||||
|
||||
Reference in New Issue
Block a user