mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +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.bridgeDetails = opts;
|
||||||
this.logger.info({bridgeDetails: this.bridgeDetails}, `time to dequeue from ${this.queueName}`);
|
this.logger.info({bridgeDetails: this.bridgeDetails}, `time to dequeue from ${this.queueName}`);
|
||||||
if (this._playSession) {
|
if (this._playSession) {
|
||||||
|
this._leave = false;
|
||||||
this._playSession.kill();
|
this._playSession.kill();
|
||||||
this._playSession = null;
|
this._playSession = null;
|
||||||
}
|
}
|
||||||
@@ -325,10 +326,9 @@ class TaskEnqueue extends Task {
|
|||||||
|
|
||||||
// check for 'leave' verb and only execute tasks up till then
|
// check for 'leave' verb and only execute tasks up till then
|
||||||
const tasksToRun = [];
|
const tasksToRun = [];
|
||||||
let leave = false;
|
|
||||||
for (const o of tasks) {
|
for (const o of tasks) {
|
||||||
if (o.name === TaskName.Leave) {
|
if (o.name === TaskName.Leave) {
|
||||||
leave = true;
|
this._leave = true;
|
||||||
this.logger.info('waitHook returned a leave task');
|
this.logger.info('waitHook returned a leave task');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -348,7 +348,7 @@ class TaskEnqueue extends Task {
|
|||||||
await this._playSession.exec();
|
await this._playSession.exec();
|
||||||
this._playSession = null;
|
this._playSession = null;
|
||||||
}
|
}
|
||||||
if (leave) {
|
if (this._leave) {
|
||||||
this.state = QueueResults.Leave;
|
this.state = QueueResults.Leave;
|
||||||
this.kill(cs);
|
this.kill(cs);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user