feat(background-agent): support 0 as unlimited concurrency
Setting concurrency to 0 means unlimited (Infinity). Works for defaultConcurrency, providerConcurrency, and modelConcurrency. 🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
parent
a423a33cbe
commit
1267a1bac5
@ -10,14 +10,20 @@ export class ConcurrencyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getConcurrencyLimit(model: string): number {
|
getConcurrencyLimit(model: string): number {
|
||||||
if (this.config?.modelConcurrency?.[model]) {
|
const modelLimit = this.config?.modelConcurrency?.[model]
|
||||||
return this.config.modelConcurrency[model]
|
if (modelLimit !== undefined) {
|
||||||
|
return modelLimit === 0 ? Infinity : modelLimit
|
||||||
}
|
}
|
||||||
const provider = model.split('/')[0]
|
const provider = model.split('/')[0]
|
||||||
if (this.config?.providerConcurrency?.[provider]) {
|
const providerLimit = this.config?.providerConcurrency?.[provider]
|
||||||
return this.config.providerConcurrency[provider]
|
if (providerLimit !== undefined) {
|
||||||
|
return providerLimit === 0 ? Infinity : providerLimit
|
||||||
}
|
}
|
||||||
return this.config?.defaultConcurrency ?? 5
|
const defaultLimit = this.config?.defaultConcurrency
|
||||||
|
if (defaultLimit !== undefined) {
|
||||||
|
return defaultLimit === 0 ? Infinity : defaultLimit
|
||||||
|
}
|
||||||
|
return 5
|
||||||
}
|
}
|
||||||
|
|
||||||
async acquire(model: string): Promise<void> {
|
async acquire(model: string): Promise<void> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user