]> git.mxchange.org Git - friendica.git/commitdiff
Small corrections
authorMichael <heluecht@pirati.ca>
Tue, 13 Jun 2017 20:51:24 +0000 (20:51 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 13 Jun 2017 20:51:24 +0000 (20:51 +0000)
doc/htconfig.md
include/poller.php

index ec961c200f680ae63c8d1f4887a70e7000e0c181..ed2c816dea75c6ca845e863579287e0b80fa15f1 100644 (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)
index 4801ea8fdf09aaa20d1998b63b0d4162ccf18b0e..6c2f9a0d6f3eedacc054e1edc0289cc5db86c7b5 100644 (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() {