6 Commits

Author SHA1 Message Date
0d0404d00d 1.0.9 2019-05-23 17:53:17 +02:00
44414ab1b4 fix(core): now killing groups of processes with negative pid 2019-05-23 17:53:16 +02:00
bcf33c718c 1.0.8 2019-05-22 12:47:38 +02:00
7a8ab962b4 fix(core): add sigkill with 10 second delay 2019-05-22 12:47:38 +02:00
29021a7ffe 1.0.7 2019-05-19 22:23:38 +02:00
ca473dcd2e fix(core): update 2019-05-19 22:23:38 +02:00
4 changed files with 17 additions and 7 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartexit",
"version": "1.0.6",
"version": "1.0.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartexit",
"version": "1.0.6",
"version": "1.0.9",
"private": false,
"description": "do things before one exists a process",
"main": "dist/index.js",
@ -21,6 +21,7 @@
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/lik": "^3.0.5"
"@pushrocks/lik": "^3.0.5",
"@pushrocks/smartdelay": "^2.0.3"
}
}

View File

@ -24,8 +24,16 @@ export class SmartExit {
console.log('found remaining child processes');
let counter = 1;
this.processesToEnd.forEach(async childProcessArg => {
console.log(`killing process #${counter}`);
childProcessArg.kill('SIGINT');
const pid = childProcessArg.pid;
console.log(`killing process #${counter} with pid ${pid}`);
plugins.smartdelay.delayFor(10000).then(() => {
if (childProcessArg.killed) {
return;
}
process.kill(-pid, 'SIGKILL');
});
process.kill(-pid, 'SIGINT');
counter++;
});
} else {

View File

@ -5,5 +5,6 @@ export { childProcess };
// pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartdelay from '@pushrocks/smartdelay';
export { lik };
export { lik, smartdelay };