summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-20 15:44:12 +0100
committerAndrew Dolgov <[email protected]>2009-01-20 15:44:12 +0100
commit0e0dd4861b3f81ba908e7a7bc738b525d3a158a3 (patch)
treea52915cb34673d0496d4ec2f2f103c2946c932da
parent602ed7f209f8fad366361ef66437bd1a72525872 (diff)
call purge_orphans from daemon main loop function
-rw-r--r--functions.php10
-rw-r--r--update_daemon_loop.php1
-rw-r--r--update_feeds.php3
3 files changed, 8 insertions, 6 deletions
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
diff --git a/update_daemon_loop.php b/update_daemon_loop.php
index 668b19abc..56b3839a2 100644
--- a/update_daemon_loop.php
+++ b/update_daemon_loop.php
@@ -79,7 +79,6 @@
_debug("Finished, $count feeds processed.");
}
-
db_close($link);
?>
diff --git a/update_feeds.php b/update_feeds.php
index e08c6f392..588a0a9b5 100644
--- a/update_feeds.php
+++ b/update_feeds.php
@@ -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");