* **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)
*/
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;
+ }
}
/**
*/
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;
+ }
}
/**
/**
* @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() {