fix(core): update

This commit is contained in:
2021-08-17 18:19:52 +02:00
parent efdb80ddba
commit 6cb7ab8f19
4 changed files with 163 additions and 364 deletions

View File

@ -21,7 +21,14 @@ export interface IExecResult {
export interface IExecResultStreaming {
childProcess: cp.ChildProcess;
finalPromise: Promise<IExecResult>;
/**
* sends SIGKILL
*/
kill: () => void;
/**
* sends SIGTERM
*/
terminate: () => void;
}
// -- SmartShell --
@ -94,8 +101,13 @@ export class Smartshell {
finalPromise: childProcessEnded.promise,
kill: () => {
// this notation with the - kills the whole process group
console.log(`running tree kill on process ${execChildProcess.pid}`);
plugins.treeKill(execChildProcess.pid);
console.log(`running tree kill with SIGKILL on process ${execChildProcess.pid}`);
plugins.treeKill(execChildProcess.pid, 'SIGKILL');
},
terminate: () => {
// this notation with the - kills the whole process group
console.log(`running tree kill with SIGTERM on process ${execChildProcess.pid}`);
plugins.treeKill(execChildProcess.pid, 'SIGTERM');
},
});
}