Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 7156c23

Browse files
author
kirankumar-ravuri
authored
Fix for multiple outstanding selfClean timers (#677)
1 parent 5fc8bf2 commit 7156c23

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/agent/conference/conference.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ var Conference = function (rpcClient, selfRpcId) {
229229
* }
230230
*/
231231
var subscriptions = {};
232+
var selfCleanTimer = null;
232233

233234
var rpcChannel = require('./rpcChannel')(rpcClient),
234235
rpcReq = require('./rpcRequest')(rpcChannel);
@@ -448,6 +449,8 @@ var Conference = function (rpcClient, selfRpcId) {
448449
subscriptions = {};
449450
streams = {};
450451
participants = {};
452+
selfCleanTimer && clearTimeout(selfCleanTimer);
453+
selfCleanTimer = null;
451454
room_id = undefined;
452455
};
453456

@@ -817,7 +820,9 @@ var Conference = function (rpcClient, selfRpcId) {
817820
};
818821

819822
const selfClean = () => {
820-
setTimeout(function() {
823+
selfCleanTimer && clearTimeout(selfCleanTimer);
824+
selfCleanTimer = setTimeout(function() {
825+
selfCleanTimer = null;
821826
if (roomIsIdle()) {
822827
log.info('Empty room ', room_id, '. Deleting it');
823828
destroyRoom();

0 commit comments

Comments
 (0)