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

Method failAll

src/extraction/store-writer.ts:129–137  ·  view source on GitHub ↗
(err: Error)

Source from the content-addressed store, hash-verified

127 }
128
129 private failAll(err: Error): void {
130 if (!this.firstError) this.firstError = err;
131 for (const [, waiter] of this.drainWaiters) waiter.reject(this.firstError);
132 this.drainWaiters.clear();
133 this.outstanding = 0;
134 const waiters = this.belowWaiters;
135 this.belowWaiters = [];
136 for (const w of waiters) w.resolve(); // send() will surface firstError
137 }
138
139 private settleOne(): void {
140 if (this.outstanding > 0) this.outstanding--;

Callers 1

constructorMethod · 0.95

Calls 2

resolveMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected