mirror of
https://github.com/friendica/friendica
synced 2025-04-25 13:50:10 +00:00
Sometimes the function "sys_getloadavg" doesn't return an array. This is a workaround.
This commit is contained in:
parent
791d152b8f
commit
6e03477598
7 changed files with 43 additions and 27 deletions
|
@ -27,10 +27,11 @@ function cronhooks_run(&$argv, &$argc){
|
|||
$maxsysload = intval(get_config('system','maxloadavg'));
|
||||
if($maxsysload < 1)
|
||||
$maxsysload = 50;
|
||||
if(function_exists('sys_getloadavg')) {
|
||||
$load = sys_getloadavg();
|
||||
if(intval($load[0]) > $maxsysload) {
|
||||
logger('system: load ' . $load[0] . ' too high. Cronhooks deferred to next scheduled run.');
|
||||
|
||||
$load = current_load();
|
||||
if($load) {
|
||||
if(intval($load) > $maxsysload) {
|
||||
logger('system: load ' . $load . ' too high. Cronhooks deferred to next scheduled run.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue