Small corrections

This commit is contained in:
Michael 2017-06-13 20:51:24 +00:00
parent 5183de8075
commit a056afd566
2 changed files with 11 additions and 7 deletions

View file

@ -68,7 +68,7 @@ Example: To set the directory value please add this line to your .htconfig.php:
* **ostatus_poll_timeframe** - Defines how old an item can be to try to complete the conversation with it.
* **paranoia** (Boolean) - Log out users if their IP address changed.
* **permit_crawling** (Boolean) - Restricts the search for not logged in users to one search per minute.
* **worker_debug** (Boolean) - If activated, it prints out the number of running processes split by priority.
* **worker_debug** (Boolean) - If enabled, it prints out the number of running processes split by priority.
* **profiler** (Boolean) - Enable internal timings to help optimize code. Needed for "rendertime" addon. Default is false.
* **free_crawls** - Number of "free" searches when "permit_crawling" is activated (Default value is 10)
* **crawl_permit_period** - Period in seconds between allowed searches when the number of free searches is reached and "permit_crawling" is activated (Default value is 60)

View file

@ -130,7 +130,11 @@ function poller_run($argv, $argc){
*/
function poller_total_entries() {
$s = q("SELECT COUNT(*) AS `total` FROM `workerqueue` WHERE `executed` <= '%s'", dbesc(NULL_DATE));
return $s[0]["total"];
if (dbm::is_result($s)) {
return $s[0]["total"];
} else {
return 0;
}
}
/**
@ -140,7 +144,11 @@ function poller_total_entries() {
*/
function poller_highest_priority() {
$s = q("SELECT `priority` FROM `workerqueue` WHERE `executed` <= '%s' ORDER BY `priority` LIMIT 1", dbesc(NULL_DATE));
return $s[0]["priority"];
if (dbm::is_result($s)) {
return $s[0]["priority"];
} else {
return 0;
}
}
/**
@ -459,10 +467,6 @@ function poller_kill_stale_workers() {
/**
* @brief Checks if the number of active workers exceeds the given limits
*
* @param integer $entries The number of not executed entries in the worker queue
* @param integer $top_priority The highest not executed priority in the worker queue
* @param boolean $high_running Is a process with priority "$top_priority" running?
*
* @return bool Are there too much workers running?
*/
function poller_too_much_workers() {