mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-08-07 14:47:26 +02:00
* pass arbitrary CLI arguments to update daemon via updater.sh entrypoint
* add configurable log level for update daemon (DAEMON_LOG_LEVEL) * when daemon log level is set to LOG_EXTENDED (2) log queries for feed update selection
This commit is contained in:
parent
d7a6f74ae5
commit
db3e67b3fe
@ -30,4 +30,4 @@ while [ ! -s $DST_DIR/config.php -a -e $DST_DIR/.app_is_ready ]; do
|
|||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo -E -u app /usr/bin/php83 /var/www/html/tt-rss/update_daemon2.php
|
sudo -E -u app /usr/bin/php83 /var/www/html/tt-rss/update_daemon2.php "$@"
|
||||||
|
@ -121,6 +121,9 @@ class Config {
|
|||||||
/** max concurrent update jobs forking update daemon starts */
|
/** max concurrent update jobs forking update daemon starts */
|
||||||
const DAEMON_MAX_JOBS = "DAEMON_MAX_JOBS";
|
const DAEMON_MAX_JOBS = "DAEMON_MAX_JOBS";
|
||||||
|
|
||||||
|
/** log level for update daemon */
|
||||||
|
const DAEMON_LOG_LEVEL = "DAEMON_LOG_LEVEL";
|
||||||
|
|
||||||
/** How long to wait for response when requesting feed from a site (seconds) */
|
/** How long to wait for response when requesting feed from a site (seconds) */
|
||||||
const FEED_FETCH_TIMEOUT = "FEED_FETCH_TIMEOUT";
|
const FEED_FETCH_TIMEOUT = "FEED_FETCH_TIMEOUT";
|
||||||
|
|
||||||
@ -229,6 +232,7 @@ class Config {
|
|||||||
Config::T_STRING ],
|
Config::T_STRING ],
|
||||||
Config::DAEMON_MAX_CHILD_RUNTIME => [ 1800, Config::T_INT ],
|
Config::DAEMON_MAX_CHILD_RUNTIME => [ 1800, Config::T_INT ],
|
||||||
Config::DAEMON_MAX_JOBS => [ 2, Config::T_INT ],
|
Config::DAEMON_MAX_JOBS => [ 2, Config::T_INT ],
|
||||||
|
Config::DAEMON_LOG_LEVEL => [ Debug::LOG_NORMAL, Config::T_INT ],
|
||||||
Config::FEED_FETCH_TIMEOUT => [ 45, Config::T_INT ],
|
Config::FEED_FETCH_TIMEOUT => [ 45, Config::T_INT ],
|
||||||
Config::FEED_FETCH_NO_CACHE_TIMEOUT => [ 15, Config::T_INT ],
|
Config::FEED_FETCH_NO_CACHE_TIMEOUT => [ 15, Config::T_INT ],
|
||||||
Config::FILE_FETCH_TIMEOUT => [ 45, Config::T_INT ],
|
Config::FILE_FETCH_TIMEOUT => [ 45, Config::T_INT ],
|
||||||
|
@ -148,7 +148,7 @@ class RSSUtils {
|
|||||||
$updstart_thresh_qpart
|
$updstart_thresh_qpart
|
||||||
$query_order $query_limit";
|
$query_order $query_limit";
|
||||||
|
|
||||||
//print "$query\n";
|
Debug::log("base feed query: $query", Debug::LOG_EXTENDED);
|
||||||
|
|
||||||
$res = $pdo->query($query);
|
$res = $pdo->query($query);
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ class RSSUtils {
|
|||||||
$update_limit_qpart
|
$update_limit_qpart
|
||||||
ORDER BY f.id $query_limit";
|
ORDER BY f.id $query_limit";
|
||||||
|
|
||||||
//print "$user_query\n";
|
Debug::log("per-user feed query: $user_query", Debug::LOG_EXTENDED);
|
||||||
|
|
||||||
// since we have feed xml cached, we can deal with other feeds with the same url
|
// since we have feed xml cached, we can deal with other feeds with the same url
|
||||||
$usth = $pdo->prepare($user_query);
|
$usth = $pdo->prepare($user_query);
|
||||||
|
@ -144,10 +144,14 @@
|
|||||||
|
|
||||||
Debug::set_enabled(true);
|
Debug::set_enabled(true);
|
||||||
|
|
||||||
|
$log_level = Debug::map_loglevel(Config::get(Config::DAEMON_LOG_LEVEL));
|
||||||
|
|
||||||
if (isset($options["log-level"])) {
|
if (isset($options["log-level"])) {
|
||||||
Debug::set_loglevel(Debug::map_loglevel((int)$options["log-level"]));
|
$log_level = Debug::map_loglevel((int)$options["log-level"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug::set_loglevel((int) $log_level);
|
||||||
|
|
||||||
if (isset($options["log"])) {
|
if (isset($options["log"])) {
|
||||||
Debug::set_quiet(isset($options['quiet']));
|
Debug::set_quiet(isset($options['quiet']));
|
||||||
Debug::set_logfile($options["log"]);
|
Debug::set_logfile($options["log"]);
|
||||||
@ -246,7 +250,7 @@
|
|||||||
|
|
||||||
$my_pid = posix_getpid();
|
$my_pid = posix_getpid();
|
||||||
|
|
||||||
passthru(Config::get(Config::PHP_EXECUTABLE) . " update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid");
|
passthru(Config::get(Config::PHP_EXECUTABLE) . " update.php --daemon-loop $quiet $log --log-level $log_level --task $j --pidlock $my_pid");
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user