set ttrss_feeds.last_successful_update as needed

This commit is contained in:
Andrew Dolgov 2020-09-30 16:35:50 +03:00
parent da5deaaca1
commit e641547d37
1 changed files with 20 additions and 9 deletions

View File

@ -497,15 +497,21 @@ class RSSUtils {
Debug::log("unable to fetch: $fetch_last_error [$fetch_last_error_code]", Debug::$LOG_VERBOSE); Debug::log("unable to fetch: $fetch_last_error [$fetch_last_error_code]", Debug::$LOG_VERBOSE);
// If-Modified-Since // If-Modified-Since
if ($fetch_last_error_code != 304) { if ($fetch_last_error_code == 304) {
$error_message = $fetch_last_error;
} else {
Debug::log("source claims data not modified, nothing to do.", Debug::$LOG_VERBOSE); Debug::log("source claims data not modified, nothing to do.", Debug::$LOG_VERBOSE);
$error_message = ""; $error_message = "";
}
$sth = $pdo->prepare("UPDATE ttrss_feeds SET last_error = ?,
last_successful_update = NOW(),
last_updated = NOW() WHERE id = ?");
} else {
$error_message = $fetch_last_error;
$sth = $pdo->prepare("UPDATE ttrss_feeds SET last_error = ?, $sth = $pdo->prepare("UPDATE ttrss_feeds SET last_error = ?,
last_updated = NOW() WHERE id = ?"); last_updated = NOW() WHERE id = ?");
}
$sth->execute([$error_message, $feed]); $sth->execute([$error_message, $feed]);
return $error_message == ""; return $error_message == "";
@ -1232,8 +1238,11 @@ class RSSUtils {
Feeds::purge_feed($feed, 0); Feeds::purge_feed($feed, 0);
$sth = $pdo->prepare("UPDATE ttrss_feeds $sth = $pdo->prepare("UPDATE ttrss_feeds SET
SET last_updated = NOW(), last_unconditional = NOW(), last_error = '' WHERE id = ?"); last_updated = NOW(),
last_unconditional = NOW(),
last_successful_update = NOW(),
last_error = '' WHERE id = ?");
$sth->execute([$feed]); $sth->execute([$feed]);
} else { } else {
@ -1248,8 +1257,10 @@ class RSSUtils {
} }
} }
$sth = $pdo->prepare("UPDATE ttrss_feeds SET last_error = ?, $sth = $pdo->prepare("UPDATE ttrss_feeds SET
last_updated = NOW(), last_unconditional = NOW() WHERE id = ?"); last_error = ?,
last_updated = NOW(),
last_unconditional = NOW() WHERE id = ?");
$sth->execute([$error_msg, $feed]); $sth->execute([$error_msg, $feed]);
unset($rss); unset($rss);