MCPcopy
hub / github.com/di-sukharev/opencommit / setupTimeout

Function setupTimeout

out/cli.cjs:66542–66556  ·  view source on GitHub ↗
(spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise)

Source from the content-addressed store, hash-verified

66540 if (killResult) {
66541 context.isCanceled = true;
66542 }
66543};
66544var timeoutKill = (spawned, signal, reject) => {
66545 spawned.kill(signal);
66546 reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
66547};
66548var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
66549 if (timeout === 0 || timeout === void 0) {
66550 return spawnedPromise;
66551 }
66552 let timeoutId;
66553 const timeoutPromise = new Promise((resolve, reject) => {
66554 timeoutId = setTimeout(() => {
66555 timeoutKill(spawned, killSignal, reject);
66556 }, timeout);
66557 });
66558 const safeSpawnedPromise = spawnedPromise.finally(() => {
66559 clearTimeout(timeoutId);

Callers 1

execaFunction · 0.85

Calls 4

setTimeoutFunction · 0.85
timeoutKillFunction · 0.85
clearTimeoutFunction · 0.85
finallyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…