diff options
author | Morgan Collett <morgan.collett@gmail.com> | 2007-07-10 13:55:38 (GMT) |
---|---|---|
committer | Morgan Collett <morgan.collett@gmail.com> | 2007-07-10 13:55:38 (GMT) |
commit | 3d886d9fc3524711e9cad9d5d47a121edeb363ad (patch) | |
tree | 1ce5129c406db076234d4e00416f761c008eb558 /src/linklocal_plugin.py | |
parent | be483751a0c291f70636bb702ed838e3adbbb9c0 (diff) |
Reapply "Rework reconnection logic so RECONNECT_TIME is interpreted as a minimum, to avoid eating CPU if Avahi or NM becomes unstable (or if dbus-python has the buggy pre-0.82 watch_name_owner() implementation)."
This reverts commit ae18c6f3897ee10a2136b36061dab14d465198b1.
Diffstat (limited to 'src/linklocal_plugin.py')
-rw-r--r-- | src/linklocal_plugin.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/linklocal_plugin.py b/src/linklocal_plugin.py index b60eb15..10924e1 100644 --- a/src/linklocal_plugin.py +++ b/src/linklocal_plugin.py @@ -68,15 +68,19 @@ class LinkLocalPlugin(TelepathyPlugin): if unique_name: self._have_avahi = True if not had_avahi: - _logger.info('Avahi appeared on the system bus (%s) - ' - 'starting...', unique_name) - self.start() + if self._backoff_id > 0: + _logger.info('Avahi appeared on the system bus (%s) - ' + 'will start when retry time is reached') + else: + _logger.info('Avahi appeared on the system bus (%s) - ' + 'starting...', unique_name) + self.start() else: self._have_avahi = False if had_avahi: _logger.info('Avahi disappeared from the system bus - ' 'stopping...') - self.stop() + self._stop() def cleanup(self): TelepathyPlugin.cleanup(self) @@ -85,7 +89,7 @@ class LinkLocalPlugin(TelepathyPlugin): self._watch = None def _could_connect(self): - return self._have_avahi + return TelepathyPlugin._could_connect(self) and self._have_avahi def _get_account_info(self): """Retrieve connection manager parameters for this account |