(t0: number, why: string, worth?: number)
| 2916 | // declined. |
| 2917 | let poolEngageTried = false; |
| 2918 | const createPool = (t0: number, why: string, worth?: number): ResolverPool | null => { |
| 2919 | poolEngageTried = true; |
| 2920 | if (!parallel) return null; |
| 2921 | const p = ResolverPool.tryCreate(parallel.dbPath, this.projectRoot, parallel.shareFrameworks ? this.getDetectedFrameworks() : undefined, worth); |
| 2922 | if (p && parallel.shareFrameworks) { |
| 2923 | const scans = this.projectScans(); |
| 2924 | if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] project scans: ${scans.cpp ? 'shared' : 'none'}`); |
| 2925 | if (scans.cpp) p.shareScans(scans); |
| 2926 | } |
| 2927 | p?.ready().then( |
| 2928 | () => { |
| 2929 | poolReady = true; |
| 2930 | if (process.env.CODEGRAPH_SYNTH_TIMINGS) console.error(`[pool-timing] pool ready after ${Date.now() - t0}ms (${why})`); |
| 2931 | }, |
| 2932 | () => { |
| 2933 | void p.destroy().catch(() => undefined); |
| 2934 | if (pool === p) pool = null; |
| 2935 | } |
| 2936 | ); |
| 2937 | return p; |
| 2938 | }; |
| 2939 | if (parallel && total >= minRefsForPool()) { |
| 2940 | pool = createPool(Date.now(), 'ref-count'); |
| 2941 | if (pool) await poolStartSettled(pool.ready()); |
nothing calls this directly
no test coverage detected