Remove ping timeout on disconnect handler
This commit is contained in:
parent
b600328639
commit
5fd1e7b4bf
|
@ -675,6 +675,7 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
|
|
||||||
def _disconnect(self):
|
def _disconnect(self):
|
||||||
log.info('Set state disconnected')
|
log.info('Set state disconnected')
|
||||||
|
self.get_module('Ping').remove_timeout()
|
||||||
self.connected = 0
|
self.connected = 0
|
||||||
self.disable_reconnect_timer()
|
self.disable_reconnect_timer()
|
||||||
|
|
||||||
|
|
|
@ -66,10 +66,8 @@ class Ping:
|
||||||
self.remove_timeout()
|
self.remove_timeout()
|
||||||
|
|
||||||
def _reconnect(self) -> None:
|
def _reconnect(self) -> None:
|
||||||
if not app.config.get_per('accounts', self._account, 'active'):
|
if not app.account_is_connected(self._account):
|
||||||
# Account may have been disabled
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# We haven't got the pong in time, disco and reconnect
|
# We haven't got the pong in time, disco and reconnect
|
||||||
log.warning('No reply received for keepalive ping. Reconnecting...')
|
log.warning('No reply received for keepalive ping. Reconnecting...')
|
||||||
self._con.disconnect(immediately=True)
|
self._con.disconnect(immediately=True)
|
||||||
|
|
Loading…
Reference in New Issue