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

Function spawnOnce

e2e/src/vm/tart.ts:193–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 let closed = false;
192 let child: ChildProcess | undefined;
193 const spawnOnce = (): void => {
194 child = spawn(
195 SSHPASS,
196 [
197 "-p",
198 GUEST_PASS,
199 "ssh",
200 ...SSH_OPTS,
201 "-N",
202 "-L",
203 `${localPort}:127.0.0.1:${guestPort}`,
204 `${GUEST_USER}@${ip}`,
205 ],
206 { stdio: "ignore" },
207 );
208 child.on("exit", () => {
209 if (!closed) setTimeout(spawnOnce, 2000);
210 });
211 };
212 spawnOnce();
213 const close = (): void => {
214 closed = true;

Callers 1

tartVmFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected