From b91b3e0a0ce770c6855a868ce5b361f266a6586e Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 22 May 2020 00:53:11 +0000 Subject: [PATCH] fix(core): update --- ts/tswatch.classes.watcher.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/ts/tswatch.classes.watcher.ts b/ts/tswatch.classes.watcher.ts index 0b2e7b4..34f44a0 100644 --- a/ts/tswatch.classes.watcher.ts +++ b/ts/tswatch.classes.watcher.ts @@ -20,21 +20,6 @@ export class Watcher { executor: 'bash' }); - /** - * used to execute - */ - private executionTask: plugins.taskbuffer.Task = new plugins.taskbuffer.Task({ - name: 'watcherCommandFunctionTask', - taskFunction: async () => { - if (typeof this.options.commandToExecute === 'string') { - throw new Error('cannot execute string as task'); - } - await this.options.commandToExecute(); - }, - buffered: true, - bufferMax: 1 - }); - private currentExecution: plugins.smartshell.IExecResultStreaming; private smartchokWatcher = new plugins.smartchok.Smartchok([], {}); private options: IWatcherConstructorOptions; @@ -65,16 +50,15 @@ export class Watcher { if (typeof this.options.commandToExecute === 'string') { if (this.currentExecution) { logger.log('ok', `reexecuting ${this.options.commandToExecute}`); - process.kill(this.currentExecution.childProcess.pid, 'SIGQUIT'); + process.kill(this.currentExecution.childProcess.pid, 'SIGINT'); } else { logger.log('ok', `executing ${this.options.commandToExecute} for the first time`); } this.currentExecution = await this.smartshellInstance.execStreaming( this.options.commandToExecute ); - this.currentExecution = null; } else { - await this.executionTask.trigger(); + console.log('cannot run execution task'); } }