feat: add Maximum number of Parallelism branches to env (#15964)

Co-authored-by: Xiaoba Yu <xb1823725853@gmail.com>
This commit is contained in:
XiaoBa
2025-03-18 09:32:47 +08:00
committed by GitHub
parent 939dcb4c0a
commit 5e52d4d6b3
6 changed files with 19 additions and 2 deletions

View File

@@ -416,7 +416,14 @@ export const LOOP_PADDING = {
left: 16,
}
export const PARALLEL_LIMIT = 10
let maxParallelLimit = 10
if (process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT && process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT !== '')
maxParallelLimit = Number.parseInt(process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT)
else if (globalThis.document?.body?.getAttribute('data-public-max-parallel-limit') && globalThis.document.body.getAttribute('data-public-max-parallel-limit') !== '')
maxParallelLimit = Number.parseInt(globalThis.document.body.getAttribute('data-public-max-parallel-limit') as string)
export const PARALLEL_LIMIT = maxParallelLimit
export const PARALLEL_DEPTH_LIMIT = 3
export const RETRIEVAL_OUTPUT_STRUCT = `{