MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / stopChild

Function stopChild

tooling/scripts/perf-web-runtime.mjs:569–583  ·  view source on GitHub ↗
(child)

Source from the content-addressed store, hash-verified

567}
568
569async function stopChild(child) {
570 if (!child || child.exitCode !== null) return
571 child.kill('SIGTERM')
572 const exited = await Promise.race([
573 new Promise((resolvePromise) => child.once('exit', () => resolvePromise(true))),
574 sleep(1000).then(() => false)
575 ])
576 if (!exited && child.exitCode === null) {
577 child.kill('SIGKILL')
578 await Promise.race([
579 new Promise((resolvePromise) => child.once('exit', () => resolvePromise(true))),
580 sleep(1000)
581 ])
582 }
583}
584
585async function main() {
586 await prepareWebDist()

Callers 1

mainFunction · 0.70

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected