Refactor pipeline task handling and UI flows
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user