Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion apps/webapp/app/v3/services/replayTaskRun.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export class ReplayTaskRunService extends BaseService {
taskRunFriendlyId: existingTaskRun.friendlyId,
});

const existingEnvironment = await this._prisma.runtimeEnvironment.findFirstOrThrow({
where: {
id: existingTaskRun.runtimeEnvironmentId,
},
select: {
id: true,
type: true,
},
});

const payloadPacket = await this.overrideExistingPayloadPacket(
existingTaskRun,
overrideOptions.payload
Expand All @@ -48,6 +58,11 @@ export class ReplayTaskRunService extends BaseService {
const payloadType = payloadPacket.dataType;
const metadata = overrideOptions.metadata ?? (await this.getExistingMetadata(existingTaskRun));
const tags = overrideOptions.tags ?? existingTaskRun.runTags;
// Only use the region from the existing task if neither environment is a development environment
const region =
existingEnvironment.type === "DEVELOPMENT" || authenticatedEnvironment.type === "DEVELOPMENT"
? undefined
: existingTaskRun.workerQueue;

try {
const taskQueue = await this._prisma.taskQueue.findFirst({
Expand Down Expand Up @@ -92,7 +107,7 @@ export class ReplayTaskRunService extends BaseService {
lockToVersion:
overrideOptions.version === "latest" ? undefined : overrideOptions.version,
bulkActionId: overrideOptions?.bulkActionId,
region: existingTaskRun.workerQueue,
region,
},
},
{
Expand Down
Loading