diff options
author | Andrew Dolgov <[email protected]> | 2020-10-20 15:00:10 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-10-20 15:00:10 +0300 |
commit | 8d75a542cdf594a67fd899bb38ee45c37096d550 (patch) | |
tree | 8561c0484b46f3231c7636989aae742b932f61b9 /classes | |
parent | 236013b7b93e6eea8930de98a541677f300c0341 (diff) | |
parent | f1fd5e8db134cdf296d734100552036edb9fc380 (diff) |
Merge branch 'master' of git.fakecake.org:tt-rss
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/rssutils.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index 3954f76dc..28260739b 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -187,11 +187,11 @@ class RSSUtils { // -1 can be caused by a SIGCHLD handler which daemon master process installs (not every setup, apparently) if ($exit_code != 0 && $exit_code != -1) { - $esth = $pdo->prepare("SELECT last_error FROM ttrss_feeds WHERE id = ?"); - $esth->execute([$tline["id"]]); + $festh = $pdo->prepare("SELECT last_error FROM ttrss_feeds WHERE id = ?"); + $festh->execute([$tline["id"]]); - if ($erow = $esth->fetch()) { - $error_message = $erow["last_error"]; + if ($ferow = $festh->fetch()) { + $error_message = $ferow["last_error"]; } else { $error_message = "N/A"; } @@ -201,6 +201,13 @@ class RSSUtils { Logger::get()->log(E_USER_NOTICE, sprintf("Update process for feed %d (%s, owner UID: %d) failed with exit code: %d (%s).", $tline["id"], clean($tline["title"]), $tline["owner_uid"], $exit_code, clean($error_message))); + + $combined_error_message = sprintf("Update process failed with exit code: %d (%s)", + $exit_code, clean($error_message)); + + # mark failed feed as having an update error (unless it is already marked) + $fusth = $pdo->prepare("UPDATE ttrss_feeds SET last_error = ? WHERE id = ? AND last_error = ''"); + $fusth->execute([$combined_error_message, $tline["id"]]); } } else { |