mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 02:45:16 +02:00
The function to check for maxload and the lockfile is centralized
This commit is contained in:
parent
ec9c9f0be7
commit
beb2346cfc
10 changed files with 66 additions and 172 deletions
|
@ -57,17 +57,8 @@ function delivery_run(&$argv, &$argc){
|
|||
continue;
|
||||
}
|
||||
|
||||
$maxsysload = intval(get_config('system','maxloadavg'));
|
||||
if($maxsysload < 1)
|
||||
$maxsysload = 50;
|
||||
|
||||
$load = current_load();
|
||||
if($load) {
|
||||
if(intval($load) > $maxsysload) {
|
||||
logger('system: load ' . $load . ' too high. Delivery deferred to next queue run.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (App::maxload_reached())
|
||||
return;
|
||||
|
||||
// It's ours to deliver. Remove it from the queue.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue