Standards: Rename App methods
- Rename App->max_processes_reached to App->isMaxProcessesReached - Rename App->maxload_reached to App->isMaxLoadReached
This commit is contained in:
parent
73b4e0552d
commit
d487c399dd
|
@ -42,7 +42,7 @@ if (!$a->mode == App::MODE_INSTALL) {
|
||||||
|
|
||||||
Config::load();
|
Config::load();
|
||||||
|
|
||||||
if ($a->max_processes_reached() || $a->maxload_reached()) {
|
if ($a->isMaxProcessesReached() || $a->isMaxLoadReached()) {
|
||||||
header($_SERVER["SERVER_PROTOCOL"] . ' 503 Service Temporarily Unavailable');
|
header($_SERVER["SERVER_PROTOCOL"] . ' 503 Service Temporarily Unavailable');
|
||||||
header('Retry-After: 120');
|
header('Retry-After: 120');
|
||||||
header('Refresh: 120; url=' . System::baseUrl() . "/" . $a->query_string);
|
header('Refresh: 120; url=' . System::baseUrl() . "/" . $a->query_string);
|
||||||
|
|
|
@ -972,7 +972,7 @@ class App
|
||||||
*
|
*
|
||||||
* @return bool Is the limit reached?
|
* @return bool Is the limit reached?
|
||||||
*/
|
*/
|
||||||
public function max_processes_reached()
|
public function isMaxProcessesReached()
|
||||||
{
|
{
|
||||||
// Deactivated, needs more investigating if this check really makes sense
|
// Deactivated, needs more investigating if this check really makes sense
|
||||||
return false;
|
return false;
|
||||||
|
@ -1052,7 +1052,7 @@ class App
|
||||||
*
|
*
|
||||||
* @return bool Is the load reached?
|
* @return bool Is the load reached?
|
||||||
*/
|
*/
|
||||||
public function maxload_reached()
|
public function isMaxLoadReached()
|
||||||
{
|
{
|
||||||
if ($this->is_backend()) {
|
if ($this->is_backend()) {
|
||||||
$process = 'backend';
|
$process = 'backend';
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Worker
|
||||||
self::$up_start = microtime(true);
|
self::$up_start = microtime(true);
|
||||||
|
|
||||||
// At first check the maximum load. We shouldn't continue with a high load
|
// At first check the maximum load. We shouldn't continue with a high load
|
||||||
if ($a->maxload_reached()) {
|
if ($a->isMaxLoadReached()) {
|
||||||
logger('Pre check: maximum load reached, quitting.', LOGGER_DEBUG);
|
logger('Pre check: maximum load reached, quitting.', LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class Worker
|
||||||
}
|
}
|
||||||
|
|
||||||
// Possibly there are too much database processes that block the system
|
// Possibly there are too much database processes that block the system
|
||||||
if ($a->max_processes_reached()) {
|
if ($a->isMaxProcessesReached()) {
|
||||||
logger('Pre check: maximum processes reached, quitting.', LOGGER_DEBUG);
|
logger('Pre check: maximum processes reached, quitting.', LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ class Worker
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constantly check the number of parallel database processes
|
// Constantly check the number of parallel database processes
|
||||||
if ($a->max_processes_reached()) {
|
if ($a->isMaxProcessesReached()) {
|
||||||
logger("Max processes reached for process ".$mypid, LOGGER_DEBUG);
|
logger("Max processes reached for process ".$mypid, LOGGER_DEBUG);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user