use a compatible waitpid library

This commit is contained in:
Thomas Hobson 2021-04-26 11:32:10 +12:00
parent dd31873700
commit 347f2d56d7
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
3 changed files with 721 additions and 753 deletions

1469
api/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@
"ps-list": "^7.2.0",
"semver": "^7.3.4",
"uuid": "^8.3.2",
"waitpid2": "^2.0.5",
"yargs": "^16.2.0"
},
"license": "MIT"

View File

@ -6,7 +6,7 @@ const config = require('./config');
const globals = require('./globals');
const fs = require('fs/promises');
const ps_list = require('ps-list');
const wait_pid = require('waitpid');
const wait_pid = require('waitpid2');
const job_states = {
READY: Symbol('Ready to be primed'),
@ -193,7 +193,7 @@ class Job {
processes.map(
async proc => {
process.kill(proc.pid, 'SIGKILL');
wait_pid(proc.pid); //Free zombie state process
wait_pid(proc.pid, wait_pid.WNOHANG); //Free zombie state process
}
)
);