From da25ed997e25fb31fcb0b1fe992d38992ff071d7 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 19 Nov 2019 11:01:00 +0100 Subject: Do not check for updates if we have no internet Signed-off-by: Roeland Jago Douma --- lib/private/Updater/VersionCheck.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/private') diff --git a/lib/private/Updater/VersionCheck.php b/lib/private/Updater/VersionCheck.php index 3cbd7061fe0..446e04dc5ed 100644 --- a/lib/private/Updater/VersionCheck.php +++ b/lib/private/Updater/VersionCheck.php @@ -33,7 +33,7 @@ class VersionCheck { /** @var IClientService */ private $clientService; - + /** @var IConfig */ private $config; @@ -54,6 +54,11 @@ class VersionCheck { * @return array|bool */ public function check() { + // If this server is set to have no internet connection this is all not needed + if (!$this->config->getSystemValueBool('has_internet_connection', true)) { + return false; + } + // Look up the cache - it is invalidated all 30 minutes if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true); -- cgit v1.2.3