MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / resolvePoolSize

Function resolvePoolSize

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

Source from the content-addressed store, hash-verified

109 * frees the transport and lets responses flush incrementally.
110 */
111export function resolvePoolSize(envVal: string | undefined, cpuCount: number): number {
112 if (envVal !== undefined && envVal !== '') {
113 const n = Number(envVal);
114 if (Number.isFinite(n) && n >= 0) return Math.min(Math.floor(n), MAX_POOL_SIZE);
115 // non-numeric / negative → fall through to the default
116 }
117 return Math.max(1, Math.min(cpuCount - 1, MAX_POOL_SIZE));
118}
119
120function resolveBusyTimeoutMs(): number {
121 const raw = process.env.CODEGRAPH_QUERY_BUSY_TIMEOUT_MS;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected