From 82252e9e34afd546ebb6288962e0889a0765afed Mon Sep 17 00:00:00 2001 From: Jared <129586362+Jaredee123@users.noreply.github.com> Date: Mon, 25 May 2026 12:19:18 -0700 Subject: [PATCH] Move createRun() after claim succeeds to avoid wasted run allocations Co-Authored-By: Claude Sonnet 4.6 --- backend/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 397e38a..cfba707 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -289,7 +289,6 @@ await fastify.register(async (instance) => { return reply.code(401).send({ error: "Authentication required" }); } - const run = await populateWorkflow.createRun(); const populateOutcome = await beginDatasetPopulate( parsed.data.datasetId, auth.userId, @@ -308,6 +307,8 @@ await fastify.register(async (instance) => { throw new Error(`Unexpected populate claim outcome: ${populateOutcome}`); } + const run = await populateWorkflow.createRun(); + void runPopulateWorkflowInBackground({ input: parsed.data, run,