From ebd9767926ffce8766681aec818fdf8e0628a1d5 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 12 Dec 2024 16:48:22 +0000 Subject: [PATCH] =?UTF-8?q?When=20replaying,=20using=20the=20concurrencyLi?= =?UTF-8?q?mit=20from=20the=20original=20run=E2=80=99s=20queue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/v3/services/replayTaskRun.server.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/webapp/app/v3/services/replayTaskRun.server.ts b/apps/webapp/app/v3/services/replayTaskRun.server.ts index 81abe3611a..601bb8a075 100644 --- a/apps/webapp/app/v3/services/replayTaskRun.server.ts +++ b/apps/webapp/app/v3/services/replayTaskRun.server.ts @@ -78,6 +78,14 @@ export class ReplayTaskRunService extends BaseService { environmentId: authenticatedEnvironment.id, }); + //get the queue from the original run, so we can use the same settings on the replay + const taskQueue = await this._prisma.taskQueue.findFirst({ + where: { + runtimeEnvironmentId: authenticatedEnvironment.id, + name: existingTaskRun.queue, + }, + }); + const triggerTaskService = new TriggerTaskService(); return await triggerTaskService.call( existingTaskRun.taskIdentifier, @@ -85,9 +93,12 @@ export class ReplayTaskRunService extends BaseService { { payload: parsedPayload, options: { - queue: { - name: existingTaskRun.queue, - }, + queue: taskQueue + ? { + name: taskQueue.name, + concurrencyLimit: taskQueue.concurrencyLimit ?? undefined, + } + : undefined, concurrencyKey: existingTaskRun.concurrencyKey ?? undefined, test: existingTaskRun.isTest, payloadType: payloadPacket.dataType,