summaryrefslogtreecommitdiff
path: root/classes/rssutils.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-10-01 15:59:40 +0300
committerAndrew Dolgov <[email protected]>2020-10-01 15:59:40 +0300
commit4ea407f613b40a0117ff74fba755464e7239f508 (patch)
treec502243b5685174d9421d0dbd48914d84d4ed4b5 /classes/rssutils.php
parent38a7a1da88904faf9fe5ca3c222e5f27920f3300 (diff)
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)
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-xclasses/rssutils.php7
1 files 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