Refactor pipeline task handling and UI flows

This commit is contained in:
2026-06-13 21:09:49 +02:00
parent 21c7e4c9a4
commit ff4c572157
24 changed files with 1346 additions and 236 deletions

View File

@@ -190,6 +190,13 @@ async function queueLeadPageSpeedAuditForLead(
leadId: args.leadId,
status: "pending",
currentStep: "pagespeed_insights",
workflowId: undefined,
attempt: 1,
maxAttempts: 3,
progressStep: 1,
progressTotal: 6,
progressLabel: "Audit vorbereitet",
progressPercent: 17,
counters: PAGE_SPEED_COUNTER_TEMPLATE,
createdAt: now,
updatedAt: now,
@@ -211,7 +218,7 @@ async function queueLeadPageSpeedAuditForLead(
await ctx.scheduler.runAfter(
0,
internal.pageSpeedAction.processPageSpeedAudit,
internal.auditWorkflow.startLeadAuditWorkflow,
{
runId,
},
@@ -328,7 +335,11 @@ export const startPageSpeedAuditRun = internalMutation({
return null;
}
if (run.status !== "pending") {
if (
run.status !== "pending" &&
run.status !== "failed" &&
run.status !== "running"
) {
return null;
}
@@ -400,6 +411,7 @@ export const startPageSpeedAuditRun = internalMutation({
status: "running",
currentStep: "pagespeed_insights",
startedAt: now,
finishedAt: undefined,
updatedAt: now,
errorSummary: undefined,
});