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

Method settleBatch

src/resolution/index.ts:2848–2874  ·  view source on GitHub ↗
(
      inFlight: InFlight,
      batch: UnresolvedReference[]
    )

Source from the content-addressed store, hash-verified

2846 // batch resolves concurrently. A pool failure downgrades to sequential
2847 // permanently and re-resolves this batch on the main thread.
2848 const settleBatch = async (
2849 inFlight: InFlight,
2850 batch: UnresolvedReference[]
2851 ): Promise<ResolutionResult> => {
2852 if (inFlight.mode === 'pool') {
2853 const settled = await inFlight.settled;
2854 if (settled.ok) {
2855 this.appendDeferredFromWorkers(settled.out.deferredChain, settled.out.deferredThisMember);
2856 return {
2857 resolved: settled.out.resolved,
2858 unresolved: settled.out.unresolved,
2859 stats: {
2860 total: batch.length,
2861 resolved: settled.out.resolved.length,
2862 unresolved: settled.out.unresolved.length,
2863 byMethod: settled.out.byMethod,
2864 },
2865 };
2866 }
2867 logDebug('Parallel resolution failed; falling back to sequential', {
2868 error: settled.err instanceof Error ? settled.err.message : String(settled.err),
2869 });
2870 if (pool) await pool.destroy().catch(() => undefined);
2871 pool = null;
2872 }
2873 return this.resolveBatchYielding(batch, maybeYield);
2874 };
2875
2876 // Bulk edge load: on big runs, drop the non-unique edge indexes for the
2877 // duration of the batch loop (the identity index stays — OR IGNORE dedup

Callers

nothing calls this directly

Calls 4

resolveBatchYieldingMethod · 0.95
logDebugFunction · 0.90
destroyMethod · 0.45

Tested by

no test coverage detected