- db.ts: add resetJob() and deleteJob() statements + exports - pipeline.ts: export retryJob() — resets job state and re-runs pipeline - DELETE /api/jobs/[id]: hard-delete terminal jobs (done/failed/cancelled); keep cancel-only behavior for active jobs - POST /api/jobs/[id]/retry: new endpoint; validates failed/cancelled URL job, resets and re-runs via retryJob() - jobs/[id]/+page.svelte: wire Cancel/Retry/Delete buttons with fetch calls; fix hardcoded ACCENT → accent store - jobs/+page.svelte: per-row Retry+Delete icon buttons (visible on hover); fix hardcoded ACCENT → accent store Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
37175ec791
commit
d1295ce343
@@ -59,6 +59,15 @@ const stmts = {
|
||||
UPDATE jobs SET status = @status, progress = @progress, updated_at = datetime('now')
|
||||
WHERE id = @id
|
||||
`),
|
||||
resetJob: db.prepare(`
|
||||
UPDATE jobs SET
|
||||
status = 'pending', progress = 0, error = NULL,
|
||||
mean_volume = NULL, whisper_job_id = NULL,
|
||||
output_dir = NULL, segments_json = NULL,
|
||||
updated_at = datetime('now')
|
||||
WHERE id = @id
|
||||
`),
|
||||
deleteJob: db.prepare('DELETE FROM jobs WHERE id = ?'),
|
||||
getJob: db.prepare('SELECT * FROM jobs WHERE id = ?'),
|
||||
listJobs: db.prepare('SELECT * FROM jobs ORDER BY created_at DESC, rowid DESC LIMIT 100'),
|
||||
upsertSub: db.prepare(`
|
||||
@@ -135,3 +144,11 @@ export function getAllSubscriptions(): PushSubscription[] {
|
||||
export function deletePushSubscription(endpoint: string): void {
|
||||
stmts.deleteSub.run(endpoint);
|
||||
}
|
||||
|
||||
export function resetJob(id: string): void {
|
||||
stmts.resetJob.run({ id });
|
||||
}
|
||||
|
||||
export function deleteJob(id: string): void {
|
||||
stmts.deleteJob.run(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user