Only keep one self destruct timeout, ref #255
parent
feac3f069d
commit
45a89b9f1a
|
|
@ -117,6 +117,8 @@ class Room extends EventEmitter
|
||||||
|
|
||||||
this._peers = {};
|
this._peers = {};
|
||||||
|
|
||||||
|
this._selfDestructTimeout = null;
|
||||||
|
|
||||||
// Array of mediasoup Router instances.
|
// Array of mediasoup Router instances.
|
||||||
this._mediasoupRouters = mediasoupRouters;
|
this._mediasoupRouters = mediasoupRouters;
|
||||||
|
|
||||||
|
|
@ -146,6 +148,11 @@ class Room extends EventEmitter
|
||||||
|
|
||||||
this._closed = true;
|
this._closed = true;
|
||||||
|
|
||||||
|
if (this._selfDestructTimeout)
|
||||||
|
clearTimeout(this._selfDestructTimeout);
|
||||||
|
|
||||||
|
this._selfDestructTimeout = null;
|
||||||
|
|
||||||
this._chatHistory = null;
|
this._chatHistory = null;
|
||||||
|
|
||||||
this._fileHistory = null;
|
this._fileHistory = null;
|
||||||
|
|
@ -411,7 +418,10 @@ class Room extends EventEmitter
|
||||||
{
|
{
|
||||||
logger.debug('selfDestructCountdown() started');
|
logger.debug('selfDestructCountdown() started');
|
||||||
|
|
||||||
setTimeout(() =>
|
if (this._selfDestructTimeout)
|
||||||
|
clearTimeout(this._selfDestructTimeout);
|
||||||
|
|
||||||
|
this._selfDestructTimeout = setTimeout(() =>
|
||||||
{
|
{
|
||||||
if (this._closed)
|
if (this._closed)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue