You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
514 B
17 lines
514 B
import { claimNextQueuedTask } from "#server/service/export/jobs";
|
|
import { runExportTaskWithRunning } from "#server/service/export/run";
|
|
|
|
export default defineTask({
|
|
meta: {
|
|
name: "export:process",
|
|
description: "Claim and process one queued export task",
|
|
},
|
|
async run() {
|
|
const task = await claimNextQueuedTask();
|
|
if (!task) {
|
|
return { result: "skipped: no queued task" };
|
|
}
|
|
await runExportTaskWithRunning(task.id, task);
|
|
return { result: "ok", taskId: task.id };
|
|
},
|
|
});
|
|
|