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

Method settleBatch

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

Source from the content-addressed store, hash-verified

1641 // batch resolves concurrently. A pool failure downgrades to sequential
1642 // permanently and re-resolves this batch on the main thread.
1643 const settleBatch = async (
1644 inFlight: InFlight,
1645 batch: UnresolvedReference[]
1646 ): Promise<ResolutionResult> => {
1647 if (inFlight.mode === 'pool') {
1648 const settled = await inFlight.settled;
1649 if (settled.ok) {
1650 this.appendDeferredFromWorkers(settled.out.deferredChain, settled.out.deferredThisMember);
1651 return {
1652 resolved: settled.out.resolved,
1653 unresolved: settled.out.unresolved,
1654 stats: {
1655 total: batch.length,
1656 resolved: settled.out.resolved.length,
1657 unresolved: settled.out.unresolved.length,
1658 byMethod: settled.out.byMethod,
1659 },
1660 };
1661 }
1662 logDebug('Parallel resolution failed; falling back to sequential', {
1663 error: settled.err instanceof Error ? settled.err.message : String(settled.err),
1664 });
1665 if (pool) await pool.destroy().catch(() => undefined);
1666 pool = null;
1667 }
1668 return this.resolveBatchYielding(batch, maybeYield);
1669 };
1670
1671 // Bulk edge load: on big runs, drop the non-unique edge indexes for the
1672 // 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