]> git.wh0rd.org Git - tt-rss.git/commitdiff
update_rss_feed: bailout if cache is considered valid, but older than last_updated
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 11:42:27 +0000 (15:42 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 11:42:27 +0000 (15:42 +0400)
include/rssfuncs.php

index e2b6f57f8cf3c43730ffd541b58e7e538d289d3f..49d9e6009c448a8ab7d7e33281602b37df9a701c 100644 (file)
                                        _debug("update_rss_feed: using local cache.");
                                }
 
-                               @$rss_data = file_get_contents($cache_filename);
+                               if ($cache_timestamp > $last_updated_timestamp) {
+                                       @$rss_data = file_get_contents($cache_filename);
 
-                               if ($rss_data) {
-                                       $rss_hash = sha1($rss_data);
-                                       @$rss = unserialize($rss_data);
+                                       if ($rss_data) {
+                                               $rss_hash = sha1($rss_data);
+                                               @$rss = unserialize($rss_data);
+                                       }
+                               } else {
+                                       if ($debug_enabled) {
+                                               _debug("update_rss_feed: local cache valid and older than last_updated, nothing to do.");
+                                       }
+                                       return;
                                }
                }