set low timeout for version-check and output message if check is not possible (due to connection error, downtime of server, etc.)

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-10-06 18:53:30 +02:00
parent fa3e3da7ac
commit 55d21e475d
3 changed files with 12 additions and 4 deletions

View File

@@ -43,8 +43,11 @@ if ($page == 'overview') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "checking auto-update");
// check for new version
$latestversion = HttpClient::urlGet(UPDATE_URI);
try {
$latestversion = HttpClient::urlGet(UPDATE_URI, true, 3);
} catch (\Exception $e) {
\Froxlor\UI\Response::dynamic_error("Version-check currently unavailable, please try again later");
}
$latestversion = explode('|', $latestversion);
if (is_array($latestversion) && count($latestversion) >= 1) {