From 59cf0610dd9f4eadb7129f6cc5e3148ac0ca4c7e Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 23 Jun 2021 11:14:19 -0400 Subject: [PATCH] bugfix: if enqeue task is killed because it is being replaced with new app supplied by LCC, ignore any app returned from the actionHook as LCC takes precedence --- lib/tasks/enqueue.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/enqueue.js b/lib/tasks/enqueue.js index 7941a5a3..8174593e 100644 --- a/lib/tasks/enqueue.js +++ b/lib/tasks/enqueue.js @@ -65,7 +65,7 @@ class TaskEnqueue extends Task { super.kill(cs); this.killReason = reason || KillReason.Hangup; this.logger.info(`TaskEnqueue:kill ${this.queueName} with reason ${this.killReason}`); - this.emitter.emit('kill'); + this.emitter.emit('kill', reason || KillReason.Hangup); this.notifyTaskDone(); } @@ -239,7 +239,8 @@ class TaskEnqueue extends Task { ep.unbridge().catch((err) => {}); resolve(); }) - .on('kill', () => { + .on('kill', (reason) => { + this.killReason = reason; this.logger.info(`TaskEnqueue:_bridgeLocal ending with ${this.killReason}`); ep.unbridge().catch((err) => {}); @@ -277,7 +278,6 @@ class TaskEnqueue extends Task { const {lengthOfList} = cs.srf.locals.dbHelpers; const members = await lengthOfList(this.queueName); this.dequeued = true; - cs.performQueueWebhook({ event: 'leave', queue: this.data.name,