]> git.wh0rd.org - tt-rss.git/commitdiff
updating: do not use cache timestamp if it is unusable for current feed;
authorAndrew Dolgov <fox@fakecake.org>
Wed, 24 Apr 2013 09:21:40 +0000 (13:21 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 24 Apr 2013 09:21:40 +0000 (13:21 +0400)
sort chronologically instead of random

include/functions.php
include/rssfuncs.php

index 10a3504f2abcfc7b6f55577cf17cd4a155ce096d..72b20cd062b939042639a9cafb927cc901893e60 100644 (file)
                                $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)));
                        }
index 870d772031fa2d498054eb8c4bccb1620bdc8c15..e9b9c71422f0649375c1fdf5916de4d3a5a5d781 100644 (file)
                $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
                                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)));
 
                                        _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) {