diff --git a/apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts b/apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts index 8cc10fd5c08..dfa8914813c 100644 --- a/apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts +++ b/apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts @@ -262,7 +262,7 @@ export class SharedQueueConsumer { console.log("✅ Started the SharedQueueConsumer"); - this.#doWork().finally(() => {}); + this.#doWork().finally(() => { }); } #endCurrentSpan() { @@ -417,7 +417,7 @@ export class SharedQueueConsumer { span.end(); setTimeout(() => { - this.#doWork().finally(() => {}); + this.#doWork().finally(() => { }); }, nextInterval); } }); @@ -620,8 +620,8 @@ export class SharedQueueConsumer { return existingTaskRun.lockedById ? await getWorkerDeploymentFromWorkerTask(existingTaskRun.lockedById) : existingTaskRun.lockedToVersionId - ? await getWorkerDeploymentFromWorker(existingTaskRun.lockedToVersionId) - : await findCurrentWorkerDeployment({ + ? await getWorkerDeploymentFromWorker(existingTaskRun.lockedToVersionId) + : await findCurrentWorkerDeployment({ environmentId: existingTaskRun.runtimeEnvironmentId, type: "V1", }); @@ -1650,6 +1650,12 @@ export const AttemptForExecutionGetPayload = { maxDurationInSeconds: true, tags: true, taskEventStore: true, + batch: { + select: { + id: true, + friendlyId: true, + }, + }, }, }, queue: { @@ -1754,7 +1760,11 @@ class SharedQueueTasks { slug: attempt.runtimeEnvironment.project.slug, name: attempt.runtimeEnvironment.project.name, }, - batch: undefined, // TODO: Removing this for now until we can do it more efficiently + batch: attempt.taskRun.batch + ? { + id: attempt.taskRun.batch.friendlyId, + } + : undefined, worker: { id: attempt.backgroundWorkerId, contentHash: attempt.backgroundWorker.contentHash, @@ -1900,9 +1910,9 @@ class SharedQueueTasks { async getResumePayload(attemptId: string): Promise< | { - execution: V3ProdTaskRunExecution; - completion: TaskRunExecutionResult; - } + execution: V3ProdTaskRunExecution; + completion: TaskRunExecutionResult; + } | undefined > { const attempt = await prisma.taskRunAttempt.findFirst({ diff --git a/apps/webapp/app/v3/services/createBackgroundWorker.server.ts b/apps/webapp/app/v3/services/createBackgroundWorker.server.ts index 2938164b74b..5e473d54048 100644 --- a/apps/webapp/app/v3/services/createBackgroundWorker.server.ts +++ b/apps/webapp/app/v3/services/createBackgroundWorker.server.ts @@ -274,14 +274,14 @@ async function createWorkerTask( description: task.description, filePath: task.filePath, exportName: task.exportName, - retryConfig: task.retry, - queueConfig: task.queue, - machineConfig: task.machine, + retryConfig: task.retry ?? null, + queueConfig: task.queue ?? null, + machineConfig: task.machine ?? null, triggerSource: task.triggerSource === "schedule" ? "SCHEDULED" : "STANDARD", fileId: tasksToBackgroundFiles?.get(task.id) ?? null, maxDurationInSeconds: task.maxDuration ? clampMaxDuration(task.maxDuration) : null, queueId: queue.id, - payloadSchema: task.payloadSchema as any, + payloadSchema: (task.payloadSchema as any) ?? null, }, }); } catch (error) {