MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / finish

Function finish

apps/local/src/oauth-result-store.ts:119–126  ·  view source on GitHub ↗
(result: AnyResult | null)

Source from the content-addressed store, hash-verified

117 return new Promise((resolve) => {
118 let done = false;
119 const finish = (result: AnyResult | null) => {
120 if (done) return;
121 done = true;
122 clearTimeout(timer);
123 opts.signal?.removeEventListener("abort", onAbort);
124 removeWaiter(sessionId, wake);
125 resolve(result);
126 };
127 const wake = () => finish(consumeOAuthResult(sessionId));
128 const onAbort = () => finish(null);
129 const timer = setTimeout(() => finish(null), opts.timeoutMs);

Callers 3

wakeFunction · 0.70
onAbortFunction · 0.70
waitForOAuthResultFunction · 0.70

Calls 2

removeWaiterFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected