From 609fd90f2f502f993898a27c3f8acc40a1e5dad0 Mon Sep 17 00:00:00 2001 From: seth-shi Date: Thu, 28 May 2026 17:48:04 +0800 Subject: [PATCH] fix: queue option ignored when group is not set The `queue` option in `processOptions` was nested inside the `if (opts?.group)` block, causing it to be silently ignored whenever `group` was not provided. This meant tasks were always enqueued to the default queue regardless of the `queue` option passed. Fix: move `queue` handling into its own independent block. --- packages/asynq/src/client.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/asynq/src/client.ts b/packages/asynq/src/client.ts index 2b9b2aa..ea6d75a 100644 --- a/packages/asynq/src/client.ts +++ b/packages/asynq/src/client.ts @@ -119,10 +119,9 @@ export class AsynqClient { } // Queue - if (opts?.group) { - const qname = opts.queue || ""; - base.validateQueueName(qname); - res.queue = qname; + if (opts?.queue) { + base.validateQueueName(opts.queue); + res.queue = opts.queue; } // task id