Skip to content

Commit b06c42d

Browse files
committed
perf: skip task lookup when queue override has per-trigger ttl
1 parent a788c9f commit b06c42d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ export class DefaultQueueManager implements QueueManager {
186186

187187
const defaultQueueName = `task/${taskId}`;
188188

189+
// When caller provides both a queue override and a per-trigger TTL,
190+
// we don't need any DB queries - the per-trigger TTL takes precedence
191+
if (overriddenQueueName && body.options?.ttl !== undefined) {
192+
return { queueName: overriddenQueueName, taskTtl: undefined };
193+
}
194+
189195
// Find the current worker for the environment
190196
const worker = await findCurrentWorkerFromEnvironment(environment, this.prisma);
191197

0 commit comments

Comments
 (0)