MCPcopy Create free account
hub / github.com/apache/maka / startBackendDisposal

Method startBackendDisposal

packages/runtime/src/runtime-kernel.ts:3193–3218  ·  view source on GitHub ↗
(
    sessionId: string,
    invalidation: BackendInvalidationState,
  )

Source from the content-addressed store, hash-verified

3191 }
3192
3193 private async startBackendDisposal(
3194 sessionId: string,
3195 invalidation: BackendInvalidationState,
3196 ): Promise<void> {
3197 if (!invalidation.disposal) {
3198 invalidation.disposal = (async () => {
3199 let outcome: BackendDisposalOutcome;
3200 try {
3201 outcome = await this.disposeBackendNow(sessionId);
3202 } catch (error) {
3203 outcome = { ok: false, error };
3204 }
3205 if (!outcome.ok) {
3206 invalidation.failure = new Error(
3207 `Backend invalidation is permanently quarantined for session ${sessionId}`,
3208 { cause: outcome.error },
3209 );
3210 }
3211 invalidation.resolve(outcome);
3212 if (outcome.ok && this.backendInvalidations.get(sessionId) === invalidation) {
3213 this.backendInvalidations.delete(sessionId);
3214 }
3215 })();
3216 }
3217 await invalidation.disposal;
3218 }
3219
3220 private ensureBackendInvalidation(sessionId: string): BackendInvalidationState {
3221 const existing = this.backendInvalidations.get(sessionId);

Callers 3

disposeBackendMethod · 0.95

Calls 4

disposeBackendNowMethod · 0.95
resolveMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected