fix(core): fixed orphan timer when multiple usable
events are emitted
This commit is contained in:
parent
1a60b39214
commit
fdcd9e0c5b
1 changed files with 2 additions and 1 deletions
|
@ -394,9 +394,10 @@ export class BaseTelegramClient extends EventEmitter {
|
|||
this.log.create('connection')
|
||||
)
|
||||
|
||||
this.primaryConnection.on('usable', async () => {
|
||||
this.primaryConnection.on('usable', () => {
|
||||
this._lastUpdateTime = Date.now()
|
||||
|
||||
if (this._keepAliveInterval) clearInterval(this._keepAliveInterval)
|
||||
this._keepAliveInterval = setInterval(async () => {
|
||||
if (Date.now() - this._lastUpdateTime > 900_000) {
|
||||
this._keepAliveAction()
|
||||
|
|
Loading…
Reference in a new issue