Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0d0404d00d | |||
44414ab1b4 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartexit",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartexit",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"private": false,
|
||||
"description": "do things before one exists a process",
|
||||
"main": "dist/index.js",
|
||||
|
@ -24,14 +24,15 @@ export class SmartExit {
|
||||
console.log('found remaining child processes');
|
||||
let counter = 1;
|
||||
this.processesToEnd.forEach(async childProcessArg => {
|
||||
console.log(`killing process #${counter}`);
|
||||
const pid = childProcessArg.pid;
|
||||
console.log(`killing process #${counter} with pid ${pid}`);
|
||||
plugins.smartdelay.delayFor(10000).then(() => {
|
||||
if (childProcessArg.killed) {
|
||||
return;
|
||||
}
|
||||
childProcessArg.kill('SIGKILL');
|
||||
})
|
||||
childProcessArg.kill('SIGINT');
|
||||
process.kill(-pid, 'SIGKILL');
|
||||
});
|
||||
process.kill(-pid, 'SIGINT');
|
||||
|
||||
counter++;
|
||||
});
|
||||
|
Reference in New Issue
Block a user