summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-24 13:21:40 +0400
committerAndrew Dolgov <[email protected]>2013-04-24 13:21:40 +0400
commit81c206634581595680ba784494f619ea977785f3 (patch)
tree7fcb7c944bafb0c20f93a0ec01dee91533b40ea1 /include
parent37ddf5b7e76114239085badfc0b1e5f94ca32480 (diff)
updating: do not use cache timestamp if it is unusable for current feed;
sort chronologically instead of random
Diffstat (limited to 'include')
-rw-r--r--include/functions.php2
-rw-r--r--include/rssfuncs.php9
2 files changed, 6 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php
index 10a3504f2..72b20cd06 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -320,7 +320,7 @@
$ch = curl_init($url);
}
- if ($timestamp) {
+ if ($timestamp && !$post_query) {
curl_setopt($ch, CURLOPT_HTTPHEADER,
array("If-Modified-Since: ".gmdate('D, d M Y H:i:s \G\M\T', $timestamp)));
}
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 870d77203..e9b9c7142 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -113,10 +113,8 @@
$query_limit = "";
if($limit) $query_limit = sprintf("LIMIT %d", $limit);
- $random_qpart = sql_random_function();
-
// We search for feed needing update.
- $result = db_query("SELECT DISTINCT ttrss_feeds.feed_url,$random_qpart
+ $result = db_query("SELECT DISTINCT ttrss_feeds.feed_url
FROM
ttrss_feeds, ttrss_users, ttrss_user_prefs
WHERE
@@ -125,7 +123,7 @@
AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
$login_thresh_qpart $update_limit_qpart
$updstart_thresh_qpart
- ORDER BY $random_qpart $query_limit");
+ ORDER BY last_updated $query_limit");
if($debug) _debug(sprintf("Scheduled %d feeds to update...", db_num_rows($result)));
@@ -278,6 +276,9 @@
_debug("local cache valid and older than last_updated, nothing to do.", $debug_enabled);
return;
}
+ } else {
+ _debug("local cache will not be used for this feed", $debug_enabled);
+ $cache_timestamp = 0;
}
if (!$rss) {