diff options
author | Andrew Dolgov <[email protected]> | 2019-03-06 19:06:05 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-06 19:06:05 +0300 |
commit | 38e01270d876cc7e43923629f038bbae629f307b (patch) | |
tree | ae505aaa6cf83c446267a23146ff82c5ac707fdc /classes/rssutils.php | |
parent | 26c226c8e44cd1f817aad191b4937aaa7b5674b1 (diff) |
archived feeds: expire old entries (schema bump)
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-x | classes/rssutils.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index 6048c8310..8684a2c5d 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1288,6 +1288,20 @@ class RSSUtils { } } + static function expire_feed_archive() { + Debug::log("Removing old archived feeds..."); + + $pdo = Db::pdo(); + + if (DB_TYPE == "pgsql") { + $pdo->query("DELETE FROM ttrss_archived_feeds + WHERE created < NOW() - INTERVAL '1 month'"); + } else { + $pdo->query("DELETE FROM ttrss_archived_feeds + WHERE created < DATE_SUB(NOW(), INTERVAL 1 MONTH)"); + } + } + static function expire_lock_files() { Debug::log("Removing old lock files...", Debug::$LOG_VERBOSE); @@ -1526,6 +1540,7 @@ class RSSUtils { RSSUtils::expire_cached_files(); RSSUtils::expire_lock_files(); RSSUtils::expire_error_log(); + RSSUtils::expire_feed_archive(); $count = RSSUtils::update_feedbrowser_cache(); Debug::log("Feedbrowser updated, $count feeds processed."); |