Skip to content

Commit 21d9eee

Browse files
committed
Make sure to scope queries to the runtime env
1 parent 4312701 commit 21d9eee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/webapp/app/runEngine/concerns/queues.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class DefaultQueueManager implements QueueManager {
3838
// Validate it exists for the locked worker
3939
where: {
4040
name: specifiedQueueName,
41+
runtimeEnvironmentId: request.environment.id,
4142
workers: { some: { id: lockedBackgroundWorker.id } }, // Ensure the queue is associated with any task of the locked worker
4243
},
4344
});
@@ -57,6 +58,7 @@ export class DefaultQueueManager implements QueueManager {
5758
const lockedTask = await this.prisma.backgroundWorkerTask.findFirst({
5859
where: {
5960
workerId: lockedBackgroundWorker.id,
61+
runtimeEnvironmentId: request.environment.id,
6062
slug: request.taskId,
6163
},
6264
include: {
@@ -144,6 +146,7 @@ export class DefaultQueueManager implements QueueManager {
144146
const task = await this.prisma.backgroundWorkerTask.findFirst({
145147
where: {
146148
workerId: worker.id,
149+
runtimeEnvironmentId: environment.id,
147150
slug: taskId,
148151
},
149152
include: {

0 commit comments

Comments
 (0)