fix(core): add sigkill with 10 second delay

This commit is contained in:
Philipp Kunz 2019-05-22 12:47:38 +02:00
parent 29021a7ffe
commit 7a8ab962b4
3 changed files with 11 additions and 2 deletions

View File

@ -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

@ -25,7 +25,14 @@ export class SmartExit {
let counter = 1;
this.processesToEnd.forEach(async childProcessArg => {
console.log(`killing process #${counter}`);
plugins.smartdelay.delayFor(10000).then(() => {
if (childProcessArg.killed) {
return;
}
childProcessArg.kill('SIGKILL');
})
childProcessArg.kill('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 };