Limit time to reconnect to 5 minutes. Fixes #8393
This commit is contained in:
parent
d306a39e1e
commit
57b2f234c1
1 changed files with 3 additions and 4 deletions
|
@ -932,13 +932,12 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
gajim.status_before_autoaway[self.name] = ''
|
gajim.status_before_autoaway[self.name] = ''
|
||||||
self.old_show = 'online'
|
self.old_show = 'online'
|
||||||
# this check has moved from _reconnect method
|
# this check has moved from _reconnect method
|
||||||
# do exponential backoff until 15 minutes,
|
# do exponential backoff until less than 5 minutes
|
||||||
# then small linear increase
|
|
||||||
if self.retrycount < 2 or self.last_time_to_reconnect is None:
|
if self.retrycount < 2 or self.last_time_to_reconnect is None:
|
||||||
self.last_time_to_reconnect = 5
|
self.last_time_to_reconnect = 5
|
||||||
if self.last_time_to_reconnect < 800:
|
self.last_time_to_reconnect += randomsource.randint(0, 5)
|
||||||
|
if self.last_time_to_reconnect < 200:
|
||||||
self.last_time_to_reconnect *= 1.5
|
self.last_time_to_reconnect *= 1.5
|
||||||
self.last_time_to_reconnect += randomsource.randint(0, 5)
|
|
||||||
self.time_to_reconnect = int(self.last_time_to_reconnect)
|
self.time_to_reconnect = int(self.last_time_to_reconnect)
|
||||||
log.info("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
|
log.info("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
|
||||||
gajim.idlequeue.set_alarm(self._reconnect_alarm,
|
gajim.idlequeue.set_alarm(self._reconnect_alarm,
|
||||||
|
|
Loading…
Add table
Reference in a new issue