diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2006-10-09 19:53:30 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2006-10-09 19:53:30 +0400 |
commit | 80c2f297d6d9c27971103ff0c2c5231df9ac28a9 (patch) | |
tree | 92f88d8d707a6ea17b954d5991b707ff25b50a6f /src | |
parent | 835643da913582f7dd3e9adae757b9beea71d11d (diff) |
reconnect time is now random ([5-15] if retrycount <= 5, else [15, 25])
reconnect infinitly when autoreconnect option is True. fixes #2411
Diffstat (limited to 'src')
-rw-r--r-- | src/common/connection.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/common/connection.py b/src/common/connection.py index 2d0feea4d..095cf2d4f 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -133,15 +133,14 @@ class Connection(ConnectionHandlers): self.dispatch('STATUS', 'offline') if not self.on_purpose: self.disconnect() - if gajim.config.get_per('accounts', self.name, 'autoreconnect') \ - and self.retrycount <= 10: + if gajim.config.get_per('accounts', self.name, 'autoreconnect'): self.connected = 1 self.dispatch('STATUS', 'connecting') # this check has moved from _reconnect method if self.retrycount > 5: - self.time_to_reconnect = 20 + self.time_to_reconnect = random.randint(15, 25) else: - self.time_to_reconnect = 10 + self.time_to_reconnect = random.randint(5, 15) gajim.idlequeue.set_alarm(self._reconnect_alarm, self.time_to_reconnect) elif self.on_connect_failure: @@ -365,7 +364,7 @@ class Connection(ConnectionHandlers): secure = self._secure) return else: - if not retry or self.retrycount > 10: + if not retry: self.retrycount = 0 self.time_to_reconnect = None if self.on_connect_failure: |