mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-07 18:56:26 +02:00
use a compatible waitpid library
This commit is contained in:
parent
dd31873700
commit
347f2d56d7
3 changed files with 721 additions and 753 deletions
1469
api/package-lock.json
generated
1469
api/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -14,6 +14,7 @@
|
||||||
"ps-list": "^7.2.0",
|
"ps-list": "^7.2.0",
|
||||||
"semver": "^7.3.4",
|
"semver": "^7.3.4",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
|
"waitpid2": "^2.0.5",
|
||||||
"yargs": "^16.2.0"
|
"yargs": "^16.2.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
|
|
@ -6,7 +6,7 @@ const config = require('./config');
|
||||||
const globals = require('./globals');
|
const globals = require('./globals');
|
||||||
const fs = require('fs/promises');
|
const fs = require('fs/promises');
|
||||||
const ps_list = require('ps-list');
|
const ps_list = require('ps-list');
|
||||||
const wait_pid = require('waitpid');
|
const wait_pid = require('waitpid2');
|
||||||
|
|
||||||
const job_states = {
|
const job_states = {
|
||||||
READY: Symbol('Ready to be primed'),
|
READY: Symbol('Ready to be primed'),
|
||||||
|
@ -193,7 +193,7 @@ class Job {
|
||||||
processes.map(
|
processes.map(
|
||||||
async proc => {
|
async proc => {
|
||||||
process.kill(proc.pid, 'SIGKILL');
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
wait_pid(proc.pid); //Free zombie state process
|
wait_pid(proc.pid, wait_pid.WNOHANG); //Free zombie state process
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue