MCPcopy Create free account
hub / github.com/TanStack/query / stop

Function stop

examples/lit/pagination/scripts/dev.mjs:30–48  ·  view source on GitHub ↗
(child)

Source from the content-addressed store, hash-verified

28}
29
30async function stop(child) {
31 if (!child || child.exitCode !== null) {
32 return
33 }
34
35 child.kill('SIGTERM')
36 await Promise.race([
37 once(child, 'exit'),
38 new Promise((resolve) => setTimeout(resolve, 2000)),
39 ])
40
41 if (child.exitCode === null) {
42 child.kill('SIGKILL')
43 await Promise.race([
44 once(child, 'exit'),
45 new Promise((resolve) => setTimeout(resolve, 2000)),
46 ])
47 }
48}
49
50async function run() {
51 const api = start('api', process.execPath, ['./server/index.mjs'])

Callers 1

shutdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected