added spaces + some curly braces + some usage of dbm::is_result()

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Haeder
2017-04-04 19:48:13 +02:00
committed by Roland Häder
parent 701e761c68
commit f4a33ed3f0
9 changed files with 114 additions and 84 deletions

View File

@@ -23,7 +23,7 @@ function poller_run($argv, $argc){
$a = new App(dirname(__DIR__));
}
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);
@@ -55,7 +55,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();
}
@@ -378,8 +378,9 @@ 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);
@@ -421,7 +422,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;