From 16f7dafcdff747929289bcf61d69e60d9c958a1b Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 29 Aug 2018 19:53:24 +0200 Subject: [PATCH] Only record offline internet if there was message received before --- src/Connection/ConnectionServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection/ConnectionServer.py b/src/Connection/ConnectionServer.py index 99dd5319..7abd76d7 100644 --- a/src/Connection/ConnectionServer.py +++ b/src/Connection/ConnectionServer.py @@ -266,7 +266,7 @@ class ConnectionServer(object): # Internet outage detection if time.time() - last_message_time > max(60, 60 * 10 / max(1, float(len(self.connections)) / 50)): # Offline: Last message more than 60-600sec depending on connection number - if self.has_internet: + if self.has_internet and last_message_time: self.has_internet = False self.onInternetOffline() else: