Skip to content

Commit

Permalink
Wait a bit after killing the subprocesses (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Mar 2, 2021
1 parent b4cfa68 commit c1524f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Expand Up @@ -3,6 +3,7 @@ import psTree from "ps-tree"
import util from "util"
const debug = deb("end-child-processes")
const psTreeA = util.promisify(psTree)
const delay = util.promisify(setTimeout)

export async function endChildProcesses(): Promise<void> {
const children = await psTreeA(process.pid)
Expand All @@ -19,4 +20,5 @@ export async function endChildProcesses(): Promise<void> {
debug(`cannot kill process ${processID} (${child.COMMAND}): ${e.message}`)
}
}
await delay(1)
}

0 comments on commit c1524f0

Please sign in to comment.