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

Method createPool

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

Source from the content-addressed store, hash-verified

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