fix(core): update

This commit is contained in:
Philipp Kunz 2019-05-19 22:23:17 +02:00
parent 18928310e7
commit 924309ea8e

View File

@ -2,10 +2,22 @@ import * as plugins from './smartexit.plugins';
export class SmartExit { export class SmartExit {
public processesToEnd = new plugins.lik.Objectmap<plugins.childProcess.ChildProcess>(); public processesToEnd = new plugins.lik.Objectmap<plugins.childProcess.ChildProcess>();
public async addProcess(childProcessArg: plugins.childProcess.ChildProcess) {
/**
* adds a process to be exited
* @param childProcessArg
*/
public addProcess(childProcessArg: plugins.childProcess.ChildProcess) {
this.processesToEnd.add(childProcessArg); this.processesToEnd.add(childProcessArg);
} }
/**
* removes a process to be exited
*/
public removeProcess(childProcessArg: plugins.childProcess.ChildProcess) {
this.processesToEnd.remove(childProcessArg);
}
public async killAll() { public async killAll() {
console.log('Checking for remaining child processes before exit...'); console.log('Checking for remaining child processes before exit...');
if (this.processesToEnd.getArray().length > 0) { if (this.processesToEnd.getArray().length > 0) {