X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fpoller.php;h=5560b3340e6209fc4ab82c97ecd3619bc9840afc;hb=d3cdfa610852f5dbda9bc3e29df6524eb504d068;hp=27f8c7831a12657032cff3dbf8e2c91492a9a964;hpb=5a6da8b447430174ae231a3b8203fd4bd8416cc1;p=friendica.git diff --git a/include/poller.php b/include/poller.php index 27f8c7831a..5560b3340e 100644 --- a/include/poller.php +++ b/include/poller.php @@ -17,11 +17,11 @@ require_once("boot.php"); function poller_run($argv, $argc){ global $a, $db; - if (is_null($a)) { + if(is_null($a)) { $a = new App; } - if (is_null($db)) { + if(is_null($db)) { @include(".htconfig.php"); require_once("include/dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data); @@ -49,7 +49,7 @@ function poller_run($argv, $argc){ return; } - if (($argc <= 1) OR ($argv[1] != "no_cron")) { + if(($argc <= 1) OR ($argv[1] != "no_cron")) { poller_run_cron(); } @@ -364,7 +364,7 @@ function poller_kill_stale_workers() { return; } - foreach ($r AS $pid) + foreach ($r AS $pid) { if (!posix_kill($pid["pid"], 0)) { q("UPDATE `workerqueue` SET `executed` = '%s', `pid` = 0 WHERE `pid` = %d", dbesc(NULL_DATE), intval($pid["pid"])); @@ -372,9 +372,8 @@ function poller_kill_stale_workers() { // Kill long running processes // Check if the priority is in a valid range - if (!in_array($pid["priority"], array(PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE))) { + if (!in_array($pid["priority"], array(PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE))) $pid["priority"] = PRIORITY_MEDIUM; - } // Define the maximum durations $max_duration_defaults = array(PRIORITY_CRITICAL => 360, PRIORITY_HIGH => 10, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180, PRIORITY_NEGLIGIBLE => 360); @@ -419,7 +418,7 @@ function poller_too_much_workers() { // Decrease the number of workers at higher load $load = current_load(); - if ($load) { + if($load) { $maxsysload = intval(Config::get("system", "maxloadavg", 50)); $maxworkers = $queues;