From 4ea407f613b40a0117ff74fba755464e7239f508 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Oct 2020 15:59:40 +0300 Subject: [PATCH] when auto disabling feeds based on DAEMON_UNSUCCESSFUL_DAYS_LIMIT only consider feeds with recent attempts to update (to prevent clashes with not recently logged users, etc) --- classes/rssutils.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/rssutils.php b/classes/rssutils.php index 0e95d4f03..3954f76dc 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1592,9 +1592,9 @@ class RSSUtils { $days = (int) DAEMON_UNSUCCESSFUL_DAYS_LIMIT; if (DB_TYPE == "pgsql") { - $interval_query = "last_successful_update < NOW() - INTERVAL '$days days'"; + $interval_query = "last_successful_update < NOW() - INTERVAL '$days days' AND last_updated > NOW() - INTERVAL '1 days'"; } else if (DB_TYPE == "mysql") { - $interval_query = "last_successful_update < DATE_SUB(NOW(), INTERVAL $days DAY)"; + $interval_query = "last_successful_update < DATE_SUB(NOW(), INTERVAL $days DAY) AND last_updated > DATE_SUB(NOW(), INTERVAL 1 DAY)"; } $sth = $pdo->prepare("SELECT id, title, owner_uid @@ -1608,7 +1608,8 @@ class RSSUtils { sprintf("Auto disabling feed %d (%s, UID: %d) because it failed to update for %d days.", $row["id"], clean($row["title"]), $row["owner_uid"], DAEMON_UNSUCCESSFUL_DAYS_LIMIT)); - Debug::log(sprintf("Auto-disabling feed %d (failed to update for %d days).", $row["id"], DAEMON_UNSUCCESSFUL_DAYS_LIMIT)); + Debug::log(sprintf("Auto-disabling feed %d (%s) (failed to update for %d days).", $row["id"], + clean($row["title"]), DAEMON_UNSUCCESSFUL_DAYS_LIMIT)); } $sth = $pdo->prepare("UPDATE ttrss_feeds SET update_interval = -1 WHERE