MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolvePoolSize

Function resolvePoolSize

src/mcp/query-pool.ts:151–158  ·  view source on GitHub ↗
(envVal: string | undefined, cpuCount: number)

Source from the content-addressed store, hash-verified

149 * frees the transport and lets responses flush incrementally.
150 */
151export function resolvePoolSize(envVal: string | undefined, cpuCount: number): number {
152 if (envVal !== undefined && envVal !== '') {
153 const n = Number(envVal);
154 if (Number.isFinite(n) && n >= 0) return Math.min(Math.floor(n), MAX_POOL_SIZE);
155 // non-numeric / negative → fall through to the default
156 }
157 return Math.max(1, Math.min(cpuCount - 1, MAX_POOL_SIZE));
158}
159
160function resolveBusyTimeoutMs(): number {
161 const raw = process.env.CODEGRAPH_QUERY_BUSY_TIMEOUT_MS;

Callers 2

maybeStartPoolMethod · 0.90
query-pool.test.tsFile · 0.90

Calls 1

NumberInterface · 0.85

Tested by

no test coverage detected