]> git.wh0rd.org - tt-rss.git/commitdiff
remove unnecessary mentions of global_purge_old_posts; add debugging to purge_orphans()
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 3 Oct 2010 08:19:09 +0000 (12:19 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 3 Oct 2010 08:19:09 +0000 (12:19 +0400)
functions.php
update_daemon2.php
update_daemon_loop.php
update_feeds.php

index 115bdfebd13a51b43f7604d4f111d54b3c79ed48..cdbfa4cae440986c621442839d21cfba99b0256b 100644 (file)
        } // function purge_feed
 
        /**
-        * Purge old posts from old feeds.
+        * Purge old posts from old feeds. Not used anymore, purging is done after feed update.
         * 
         * @param mixed $link A database connection
         * @param boolean $do_output Set to true to enable printed output, false by default.
         * @access public
         * @return void
         */
-       function global_purge_old_posts($link, $do_output = false, $limit = false) {
+       /* function global_purge_old_posts($link, $do_output = false, $limit = false) {
 
                $random_qpart = sql_random_function();
 
                        }
                }       
 
-               // purge orphaned posts in main content table
-               $result = db_query($link, "DELETE FROM ttrss_entries WHERE 
-                       (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
-
-               if ($do_output) {
-                       $rows = db_affected_rows($link, $result);
-                       _debug("Purged $rows orphaned posts.");
-               }
+               purge_orphans($link, $do_output);
 
-       } // function global_purge_old_posts
+       } // function global_purge_old_posts */
 
        function feed_purge_interval($link, $feed_id) {
 
                purge_orphans($link);
        }
 
-       function purge_orphans($link) {
+       function purge_orphans($link, $do_output = false) {
+
                // purge orphaned posts in main content table
-               db_query($link, "DELETE FROM ttrss_entries WHERE 
+               $result = db_query($link, "DELETE FROM ttrss_entries WHERE 
                        (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
+
+               if ($do_output) {
+                       $rows = db_affected_rows($link, $result);
+                       _debug("Purged $rows orphaned posts.");
+               }
        }
 
        function get_feed_update_interval($link, $feed_id) {
index 053a73d7d7a399f958f417e07a3fd74a4b423ee8..1b9e57638eecfafe2b55858b5bbdb44d81db9001 100755 (executable)
                                                print "warning: unable to create stampfile";
                                        }       
 
-                                       // FIXME : $last_purge is of no use in a multiprocess update.
-                                       // FIXME : We ALWAYS purge old posts.
-                                       //_debug("Purging old posts (random 30 feeds)...");
-                                       //global_purge_old_posts($link, true, 30);
-
                                        // Call to the feed batch update function 
                                        // or regenerate feedbrowser cache
 
index 0586aa4dd12794bb37342bcd33f0d15ecfaff122..7fa22d19de2debf1eaf0b1ddc9f9138bbb20619b 100755 (executable)
                die;
        }
 
-/*     if (time() - $last_purge > PURGE_INTERVAL) {
-               _debug("Purging old posts (random 30 feeds)...");
-               global_purge_old_posts($link, true, 30);
-               $last_purge = time();
-       } */
-
        // Call to the feed batch update function 
        // or regenerate feedbrowser cache
 
index 0d93358e5f7661e4ac7d3e7b15b875d0f95e59a3..6a4aa2a1b81be715ca5d792e71c68569444ed392 100755 (executable)
@@ -34,9 +34,6 @@
 
        init_connection($link);
 
-       // Purge all posts (random 30 feeds)
-       //global_purge_old_posts($link, true, 30);
-
        // Update all feeds needing a update.
        update_daemon_common($link);