mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
bugfix: if waitUrl of enqueue task includes leave but caller is dequeued before leave is reached, ignore leave
This commit is contained in:
@@ -114,6 +114,7 @@ class TaskEnqueue extends Task {
|
||||
this.bridgeDetails = opts;
|
||||
this.logger.info({bridgeDetails: this.bridgeDetails}, `time to dequeue from ${this.queueName}`);
|
||||
if (this._playSession) {
|
||||
this._leave = false;
|
||||
this._playSession.kill();
|
||||
this._playSession = null;
|
||||
}
|
||||
@@ -325,10 +326,9 @@ class TaskEnqueue extends Task {
|
||||
|
||||
// check for 'leave' verb and only execute tasks up till then
|
||||
const tasksToRun = [];
|
||||
let leave = false;
|
||||
for (const o of tasks) {
|
||||
if (o.name === TaskName.Leave) {
|
||||
leave = true;
|
||||
this._leave = true;
|
||||
this.logger.info('waitHook returned a leave task');
|
||||
break;
|
||||
}
|
||||
@@ -348,7 +348,7 @@ class TaskEnqueue extends Task {
|
||||
await this._playSession.exec();
|
||||
this._playSession = null;
|
||||
}
|
||||
if (leave) {
|
||||
if (this._leave) {
|
||||
this.state = QueueResults.Leave;
|
||||
this.kill(cs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user