Skip to content

Commit fca81fb

Browse files
committed
fix(sdk): reject more than two trigger-time named limits instead of discarding
1 parent 499479c commit fca81fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/trigger-sdk/src/v3/shared.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ function triggerConcurrencyBody(concurrency: string | string[] | undefined): {
222222
return {};
223223
}
224224
const limits = Array.isArray(concurrency) ? concurrency : [concurrency];
225-
return { concurrency: limits.slice(0, 2) };
225+
if (limits.length > 2) {
226+
throw new Error("The concurrency option accepts at most two named limits.");
227+
}
228+
return { concurrency: limits };
226229
}
227230

228231
export function queue(options: QueueOptions): Queue {

0 commit comments

Comments
 (0)