mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 21:15:55 +00:00
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)
This commit is contained in:
@@ -1592,9 +1592,9 @@ class RSSUtils {
|
|||||||
$days = (int) DAEMON_UNSUCCESSFUL_DAYS_LIMIT;
|
$days = (int) DAEMON_UNSUCCESSFUL_DAYS_LIMIT;
|
||||||
|
|
||||||
if (DB_TYPE == "pgsql") {
|
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") {
|
} 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
|
$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.",
|
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));
|
$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
|
$sth = $pdo->prepare("UPDATE ttrss_feeds SET update_interval = -1 WHERE
|
||||||
|
|||||||
Reference in New Issue
Block a user