The function to check for maxload and the lockfile is centralized

This commit is contained in:
Michael Vogel 2016-03-08 20:28:09 +01:00
commit beb2346cfc
10 changed files with 66 additions and 172 deletions

View file

@ -29,17 +29,8 @@ function poller_run(&$argv, &$argc){
if (poller_max_connections_reached())
return;
$load = current_load();
if($load) {
$maxsysload = intval(get_config('system','maxloadavg'));
if($maxsysload < 1)
$maxsysload = 50;
if(intval($load) > $maxsysload) {
logger('system: load ' . $load . ' too high. poller deferred to next scheduled run.');
return;
}
}
if (App::maxload_reached())
return;
// Checking the number of workers
if (poller_too_much_workers(1)) {