]> git.wh0rd.org Git - tt-rss.git/commitdiff
call purge_orphans from daemon main loop function
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Jan 2009 14:44:12 +0000 (15:44 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Jan 2009 14:44:12 +0000 (15:44 +0100)
functions.php
update_daemon_loop.php
update_feeds.php

index 1cdd5e2c935460f795a8dd6ef44584ec2b09e4d2..50374dc1dbe759ad4e715f9787a446dd3fbf6eee 100644 (file)
                        }
                }       
 
+               purge_orphans($link);
+       }
+
+       function purge_orphans($link) {
                // purge orphaned posts in main content table
                db_query($link, "DELETE FROM ttrss_entries WHERE 
                        (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
                        sleep(1); // prevent flood (FIXME make this an option?)
                }
 
-       // Send feed digests by email if needed.
-       if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
+               // Send feed digests by email if needed.
+               if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
+
+               purge_orphans($link);
 
        } // function update_daemon_common
 
index 668b19abca9c76808a3635562ad7ddbc011517fa..56b3839a230fb2bf49b92e15e37e6ea9574b1e70 100644 (file)
@@ -79,7 +79,6 @@
                _debug("Finished, $count feeds processed.");
        }
 
-
        db_close($link);
 
 ?>
index e08c6f3924c617daebf15a1b392f06673fa02a1f..588a0a9b570b194429b82dde51b14e023d9acd56 100644 (file)
@@ -44,9 +44,6 @@
        // Update all feeds needing a update.
        update_daemon_common($link);
 
-       // Send feed digests by email if needed.
-       if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
-
        db_close($link);
 
        unlink(LOCK_DIRECTORY . "/$lock_filename");