MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / postRun

Function postRun

scripts/runner-smoke.mjs:50–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50async function postRun() {
51 const ctrl = new AbortController();
52 const timer = setTimeout(() => ctrl.abort(), RUN_TIMEOUT_MS);
53 try {
54 const res = await fetch(`http://127.0.0.1:${PORT}/run`, {
55 method: "POST",
56 headers: { "content-type": "application/json" },
57 body: JSON.stringify({ repo: REPO, verify: ["ls"], timeoutMs: 30_000 }),
58 signal: ctrl.signal,
59 });
60 const body = await res.json();
61 if (!res.ok || !body || body.ok !== true) {
62 throw new Error(`runner /run returned ${res.status}: ${JSON.stringify(body)}`);
63 }
64 return body;
65 } finally {
66 clearTimeout(timer);
67 }
68}
69
70async function main() {
71 if (!hasDocker()) {

Callers 1

mainFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected