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

Method settleBatch

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

Source from the content-addressed store, hash-verified

2996 // batch resolves concurrently. A pool failure downgrades to sequential
2997 // permanently and re-resolves this batch on the main thread.
2998 const settleBatch = async (
2999 inFlight: InFlight,
3000 batch: UnresolvedReference[]
3001 ): Promise<ResolutionResult> => {
3002 if (inFlight.mode === 'pool') {
3003 const settled = await inFlight.settled;
3004 if (settled.ok) {
3005 this.appendDeferredFromWorkers(settled.out.deferredChain, settled.out.deferredThisMember);
3006 return {
3007 resolved: settled.out.resolved,
3008 unresolved: settled.out.unresolved,
3009 stats: {
3010 total: batch.length,
3011 resolved: settled.out.resolved.length,
3012 unresolved: settled.out.unresolved.length,
3013 byMethod: settled.out.byMethod,
3014 },
3015 };
3016 }
3017 logDebug('Parallel resolution failed; falling back to sequential', {
3018 error: settled.err instanceof Error ? settled.err.message : String(settled.err),
3019 });
3020 if (pool) await pool.destroy().catch(() => undefined);
3021 pool = null;
3022 }
3023 return this.resolveBatchYielding(batch, maybeYield);
3024 };
3025
3026 // Bulk edge load: on big runs, drop the non-unique edge indexes for the
3027 // 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