summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-03-30 13:32:49 +0300
committerAndrew Dolgov <[email protected]>2016-03-30 13:32:49 +0300
commit79c891a8b7d411343da698e7fd8e617da7c20020 (patch)
tree1bac50a903093dc6de8384e2d7eb4021403d8917 /include
parente3bc4591afbc8e93a3dbdc751d6a4e70256b81d9 (diff)
set smallish timeout on update check, exclude update checking on initial load
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/functions2.php b/include/functions2.php
index f31a61942..1c2ffb936 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -203,7 +203,7 @@
function check_for_update() {
if (defined("GIT_VERSION_TIMESTAMP")) {
- $content = @fetch_file_contents("http://tt-rss.org/version.json");
+ $content = @fetch_file_contents(array("url" => "http://tt-rss.org/version.json", "timeout" => 5));
if ($content) {
$content = json_decode($content, true);
@@ -221,7 +221,7 @@
return "";
}
- function make_runtime_info() {
+ function make_runtime_info($disable_update_check = false) {
$data = array();
$result = db_query("SELECT MAX(id) AS mid, COUNT(*) AS nf FROM
@@ -240,7 +240,7 @@
$data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
- if (CHECK_FOR_UPDATES && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
+ if (CHECK_FOR_UPDATES && !$disable_update_check && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
$update_result = @check_for_update();
$data["update_result"] = $update_result;