diff --git a/lbry/extras/daemon/analytics.py b/lbry/extras/daemon/analytics.py index daa107791..828112396 100644 --- a/lbry/extras/daemon/analytics.py +++ b/lbry/extras/daemon/analytics.py @@ -127,16 +127,14 @@ class AnalyticsManager: async def start(self): if self.task is None: - self.external_ip = await utils.get_external_ip() if self.enabled else None self.task = asyncio.create_task(self.run()) async def run(self): while True: if self.enabled: + self.external_ip = await utils.get_external_ip() await self._send_heartbeat() await asyncio.sleep(1800) - if self.enabled: - self.external_ip = await utils.get_external_ip() def stop(self): if self.task is not None and not self.task.done(): diff --git a/lbry/extras/daemon/loggly_handler.py b/lbry/extras/daemon/loggly_handler.py index 3b709fb41..6d78e2f37 100644 --- a/lbry/extras/daemon/loggly_handler.py +++ b/lbry/extras/daemon/loggly_handler.py @@ -51,7 +51,7 @@ class HTTPSLogglyHandler(logging.Handler): @property def enabled(self): - return self._toggle is None or (self._toggle and self._toggle()) + return self._toggle and self._toggle() @staticmethod def get_full_message(record):