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

Method createPool

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

Source from the content-addressed store, hash-verified

2766 // declined.
2767 let poolEngageTried = false;
2768 const createPool = (t0: number, why: string, worth?: number): ResolverPool | null => {
2769 poolEngageTried = true;
2770 if (!parallel) return null;
2771 const p = ResolverPool.tryCreate(parallel.dbPath, this.projectRoot, parallel.shareFrameworks ? this.getDetectedFrameworks() : undefined, worth);
2772 if (p && parallel.shareFrameworks) {
2773 const scans = this.projectScans();
2774 if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] project scans: ${scans.cpp ? 'shared' : 'none'}`);
2775 if (scans.cpp) p.shareScans(scans);
2776 }
2777 p?.ready().then(
2778 () => {
2779 poolReady = true;
2780 if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] pool ready after ${Date.now() - t0}ms (${why})`);
2781 },
2782 () => {
2783 void p.destroy().catch(() => undefined);
2784 if (pool === p) pool = null;
2785 }
2786 );
2787 return p;
2788 };
2789 if (parallel && total >= minRefsForPool()) {
2790 pool = createPool(Date.now(), 'ref-count');
2791 if (pool) await poolStartSettled(pool.ready());

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