mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-10-18 09:24:22 +00:00
fix assertion
This commit is contained in:
1 parent
d135247500
commit
43564502f7
2 files changed
+6
-1
No files matched your search
@@ -236,6 +236,7 @@ class CallSession extends Emitter {
|
||||
|
||||
async enableBotMode(gather, autoEnable) {
|
||||
try {
|
||||
gather.timeout = 0; // background gathers should not timeout
|
||||
const t = normalizeJambones(this.logger, [gather]);
|
||||
this.backgroundGatherTask = makeTask(this.logger, t[0]);
|
||||
this.backgroundGatherTask
|
||||
|
||||
+5
-1
@@ -190,7 +190,7 @@ class TaskGather extends Task {
|
||||
}
|
||||
|
||||
updateTimeout(timeout) {
|
||||
this.logger.info(`TaskGather:updateTimout - updating timeout to ${timeout}`);
|
||||
this.logger.info(`TaskGather:updateTimeout - updating timeout to ${timeout}`);
|
||||
this.timeout = timeout;
|
||||
this._startTimer();
|
||||
}
|
||||
@@ -317,6 +317,10 @@ class TaskGather extends Task {
|
||||
|
||||
_startTimer() {
|
||||
if (0 === this.timeout) return;
|
||||
if (this._timeoutTimer) {
|
||||
clearTimeout(this._timeoutTimer);
|
||||
this._timeoutTimer = null;
|
||||
}
|
||||
assert(!this._timeoutTimer);
|
||||
this.logger.debug(`Gather:_startTimer: timeout ${this.timeout}`);
|
||||
this._timeoutTimer = setTimeout(() => this._resolve('timeout'), this.timeout);
|
||||
|
||||
Reference in new issue
Block a user