(t0: number, why: string, worth?: number)
| 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'); |
nothing calls this directly
no test coverage detected