perf(concurrency): remove unsupported product admission limits

This commit is contained in:
mesalogo
2026-10-07 15:52:07 +08:00
parent 1f85d0c0e9
commit 8473189fe2
19 changed files with 306 additions and 90 deletions
+5 -8
View File
@@ -67,7 +67,7 @@ export function redactChannelError(value: string): string {
export class ChannelService {
private allowedSenderIds: ReadonlySet<string> = new Set()
private readonly allowGroupMessages: boolean
private readonly maximumConcurrency: number
private readonly maximumConcurrency?: number
private readonly maximumInputLength: number
private readonly dedupStore: DedupStore
private readonly outbox: Outbox
@@ -99,12 +99,9 @@ export class ChannelService {
this.updateAllowedSenderIds(options.allowedSenderIds ?? [])
this.allowGroupMessages = options.allowGroupMessages ?? false
this.maximumConcurrency = boundedInteger(
options.maximumConcurrency,
2,
100,
'通道并发限制'
)
this.maximumConcurrency = options.maximumConcurrency === undefined
? undefined
: boundedInteger(options.maximumConcurrency, 1, Number.MAX_SAFE_INTEGER, '通道并发限制')
this.maximumInputLength = boundedInteger(
options.maximumInputLength,
8_000,
@@ -340,7 +337,7 @@ export class ChannelService {
return
}
if (this.active.size >= this.maximumConcurrency) {
if (this.maximumConcurrency !== undefined && this.active.size >= this.maximumConcurrency) {
durableResult = await this.tryDeliver(
this.result(message, {
status: 'busy',