From 0e0dd4861b3f81ba908e7a7bc738b525d3a158a3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 20 Jan 2009 15:44:12 +0100 Subject: call purge_orphans from daemon main loop function --- functions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 1cdd5e2c9..50374dc1d 100644 --- a/functions.php +++ b/functions.php @@ -311,6 +311,10 @@ } } + 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"); @@ -5707,8 +5711,10 @@ 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 -- cgit v1.2.3-54-g00ecf