mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
fix assertion
This commit is contained in:
@@ -236,6 +236,7 @@ class CallSession extends Emitter {
|
|||||||
|
|
||||||
async enableBotMode(gather, autoEnable) {
|
async enableBotMode(gather, autoEnable) {
|
||||||
try {
|
try {
|
||||||
|
gather.timeout = 0; // background gathers should not timeout
|
||||||
const t = normalizeJambones(this.logger, [gather]);
|
const t = normalizeJambones(this.logger, [gather]);
|
||||||
this.backgroundGatherTask = makeTask(this.logger, t[0]);
|
this.backgroundGatherTask = makeTask(this.logger, t[0]);
|
||||||
this.backgroundGatherTask
|
this.backgroundGatherTask
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class TaskGather extends Task {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateTimeout(timeout) {
|
updateTimeout(timeout) {
|
||||||
this.logger.info(`TaskGather:updateTimout - updating timeout to ${timeout}`);
|
this.logger.info(`TaskGather:updateTimeout - updating timeout to ${timeout}`);
|
||||||
this.timeout = timeout;
|
this.timeout = timeout;
|
||||||
this._startTimer();
|
this._startTimer();
|
||||||
}
|
}
|
||||||
@@ -317,6 +317,10 @@ class TaskGather extends Task {
|
|||||||
|
|
||||||
_startTimer() {
|
_startTimer() {
|
||||||
if (0 === this.timeout) return;
|
if (0 === this.timeout) return;
|
||||||
|
if (this._timeoutTimer) {
|
||||||
|
clearTimeout(this._timeoutTimer);
|
||||||
|
this._timeoutTimer = null;
|
||||||
|
}
|
||||||
assert(!this._timeoutTimer);
|
assert(!this._timeoutTimer);
|
||||||
this.logger.debug(`Gather:_startTimer: timeout ${this.timeout}`);
|
this.logger.debug(`Gather:_startTimer: timeout ${this.timeout}`);
|
||||||
this._timeoutTimer = setTimeout(() => this._resolve('timeout'), this.timeout);
|
this._timeoutTimer = setTimeout(() => this._resolve('timeout'), this.timeout);
|
||||||
|
|||||||
Reference in New Issue
Block a user