1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 22:55:55 +00:00

update-feed: exit with non-zero exit code if update_rss_feed() failed

daemon: log if per-feed update task terminated with non-zero exit code
This commit is contained in:
Andrew Dolgov
2020-09-27 16:42:42 +03:00
parent 0761533d0a
commit d4d0e976dc
2 changed files with 13 additions and 3 deletions

View File

@@ -150,7 +150,8 @@ class RSSUtils {
$log = function_exists("flock") && isset($options['log']) ? '--log '.$options['log'] : '';
$log_level = isset($options['log-level']) ? '--log-level '.$options['log-level'] : '';
passthru(PHP_EXECUTABLE . " update.php --update-feed " . $tline["id"] . " --pidlock feed-" . $tline["id"] . " $quiet $log $log_level");
$exit_code = 0;
passthru(PHP_EXECUTABLE . " update.php --update-feed " . $tline["id"] . " --pidlock feed-" . $tline["id"] . " $quiet $log $log_level", $exit_code);
/* try {
self::update_rss_feed($tline["id"], true, false);
@@ -165,7 +166,11 @@ class RSSUtils {
}
} */
Debug::log(sprintf(" %.4f (sec)", microtime(true) - $fstarted));
Debug::log(sprintf(" %.4f (sec) RC=%d", microtime(true) - $fstarted, $exit_code));
if ($exit_code != 0) {
Logger::get()->log(sprintf("Update process for feed %d terminated with non-zero exit code: %d", $tline["id"], $exit_code));
}
++$nf;
}