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

Method settleBatch

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

Source from the content-addressed store, hash-verified

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