]> git.wh0rd.org Git - tt-rss.git/commitdiff
regenerate feedbrowser cache from the update daemon
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 11:06:42 +0000 (12:06 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 11:06:42 +0000 (12:06 +0100)
update_daemon2.php
update_daemon_loop.php
update_feedbrowser.php

index 08f5d74c3e292c4be6c0544d1120dfb4f4114c29..a85bc1f5260ebd266c50ccf6c68ba34f3f4839dc 100644 (file)
                                        //      $last_purge = time();
                                        // }
 
-                                       // Call to the feed batch update function
-                                       update_daemon_common($link);
+                                       // Call to the feed batch update function 
+                                       // or regenerate feedbrowser cache
+
+                                       if (rand(0,100) > 50) {
+                                               update_daemon_common($link);
+                                       } else {
+                                               $count = update_feedbrowser_cache($link);
+                                               _debug("Finished, $count feeds processed.");
+                                       }
 
                                        _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)");
  
index b1197ff3494801862920989f0e1c6e50a31ef0fb..c82ee561b9c17d3022b12a9736730aff1a33211c 100644 (file)
                $last_purge = time();
        }
 
-       // FIXME: get all scheduled updates w/forced refetch
-       // Stub, until I figure out if it is really needed.
+       // Call to the feed batch update function 
+       // or regenerate feedbrowser cache
 
-#              $result = db_query($link, "SELECT * FROM ttrss_scheduled_updates ORDER BY id");
-#              while ($line = db_fetch_assoc($result)) {
-#                      print "Scheduled feed update: " . $line["feed_id"] . ", UID: " . 
-#                              $line["owner_uid"] . "\n";
-#              }
-
-       // Process all other feeds using last_updated and interval parameters
-
-//     $random_qpart = sql_random_function();
-
-/*             
-                               ttrss_entries.date_entered < NOW() - INTERVAL '$purge_interval days'");
-               }
-
-               $rows = pg_affected_rows($result);
-               
+       if (rand(0,100) > 50) {
+               update_daemon_common($link);
        } else {
+               $count = update_feedbrowser_cache($link);
+               print "Finished, $count feeds processed.\n";
+       }
 
-               $result = db_query($link, "DELETE FROM ttrss_user_entries 
-                       USING ttrss_user_entries, ttrss_entries 
-                       WHERE ttrss_entries.id = ref_id AND 
-                       marked = false AND 
-                       feed_id = '$feed_id' AND 
-                       ttrss_entries.date_entered < DATE_SUB(NOW(), INTERVAL $purge_interval DAY)"); */                
-
-       // Call to the feed batch update function
-       update_daemon_common($link);
 
        db_close($link);
 
index 4698918d561cfc82b4956db79e4b4ea3bcf64e07..0031ff31538761eb30678d3b1f09d4636ad57263 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/bin/php
 <?php
-       // this script is probably run not from your httpd-user, so cache
-       // directory defined in config.php won't be accessible
-       define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache-cli');
-       define('SIMPLEPIE_CACHE_DIR',   '/var/tmp/simplepie-ttrss-cache-cli');
+       /* This script updates feedbrowser (e.g. Other Feeds tab) cache
+        * If you are using update daemon, it is NOT necessary to run
+        * this script, as updates are handled automatically. */
+
        define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE);
        define('DISABLE_SESSIONS', true);