diff options
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.php b/functions.php index 0d668eda6..46d010237 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,13 @@ <? require_once 'config.php'; + function purge_old_posts() { + if (PURGE_OLD_DAYS) { + $result = pg_query("DELETE FROM ttrss_entries WHERE + date_entered < NOW() - INTERVAL '30 days'"); + } + } + function update_all_feeds($link, $fetch) { if (WEB_DEMO_MODE) return; @@ -23,6 +30,8 @@ update_rss_feed($link, $line["feed_url"], $line["id"]); } + purge_old_posts(); + pg_query("COMMIT"); } |