mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
fix #714
This commit is contained in:
@@ -26,7 +26,7 @@ class BackgroundTaskManager extends Emitter {
|
||||
return this.tasks.size;
|
||||
}
|
||||
|
||||
async newTask(type, opts) {
|
||||
async newTask(type, opts, sticky = false) {
|
||||
this.logger.info({opts}, `initiating Background task ${type}`);
|
||||
if (this.tasks.has(type)) {
|
||||
this.logger.info(`Background task ${type} is running, skipped`);
|
||||
@@ -52,6 +52,7 @@ class BackgroundTaskManager extends Emitter {
|
||||
if (task) {
|
||||
this.tasks.set(type, task);
|
||||
}
|
||||
if (task && sticky) task.sticky = true;
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ class BackgroundTaskManager extends Emitter {
|
||||
this._taskCompleted('bargeIn', task);
|
||||
if (task.sticky && !this.cs.callGone && !this.cs._stopping) {
|
||||
this.logger.info('BackgroundTaskManager:_initBargeIn: restarting background bargeIn');
|
||||
this.newTask('bargeIn', opts);
|
||||
this.newTask('bargeIn', opts, true);
|
||||
}
|
||||
return;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user