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

Method createPool

src/resolution/index.ts:2983–3009  ·  view source on GitHub ↗
(t0: number, why: string, worth?: number)

Source from the content-addressed store, hash-verified

2981 // declined.
2982 let poolEngageTried = false;
2983 const createPool = (t0: number, why: string, worth?: number): ResolverPool | null => {
2984 poolEngageTried = true;
2985 if (!parallel) return null;
2986 const p = ResolverPool.tryCreate(
2987 parallel.dbPath,
2988 this.projectRoot,
2989 parallel.shareFrameworks ? this.getDetectedFrameworks() : undefined,
2990 worth,
2991 parallel.beforePool
2992 );
2993 if (p && parallel.shareFrameworks) {
2994 const scans = this.projectScans();
2995 if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] project scans: ${scans.cpp ? 'shared' : 'none'}`);
2996 if (scans.cpp) p.shareScans(scans);
2997 }
2998 p?.ready().then(
2999 () => {
3000 poolReady = true;
3001 if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] pool ready after ${Date.now() - t0}ms (${why})`);
3002 },
3003 () => {
3004 void p.destroy().catch(() => undefined);
3005 if (pool === p) pool = null;
3006 }
3007 );
3008 return p;
3009 };
3010 const startBeforeFirstBatch = parallel ? poolStartBeforeFirstBatch(total, parallel.shareFrameworks === true) : null;
3011 if (startBeforeFirstBatch) {
3012 pool = createPool(Date.now(), startBeforeFirstBatch === 'up-front' ? 'ref-count' : 'near-gate');

Callers

nothing calls this directly

Calls 7

getDetectedFrameworksMethod · 0.95
projectScansMethod · 0.95
tryCreateMethod · 0.80
shareScansMethod · 0.80
errorMethod · 0.65
readyMethod · 0.65
destroyMethod · 0.45

Tested by

no test coverage detected