fix(core): update
This commit is contained in:
parent
18928310e7
commit
924309ea8e
14
ts/index.ts
14
ts/index.ts
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user