X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSystem.php;h=44512390617e53008b859e1f229b159c7abf566a;hb=06284e60073f374c1bd411e0bba6474a13c14f10;hp=44249175a72341540ace92e1bb6294dacc70779e;hpb=7c6554451e921e500ac503383945acc6d3a2ba2c;p=friendica.git diff --git a/src/Core/System.php b/src/Core/System.php index 44249175a7..4451239061 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -42,11 +42,6 @@ class System */ private $logger; - /** - * @var App\Mode - */ - private $mode; - /** * @var IManageConfigValues */ @@ -57,10 +52,9 @@ class System */ private $basePath; - public function __construct(LoggerInterface $logger, App\Mode $mode, IManageConfigValues $config, string $basepath) + public function __construct(LoggerInterface $logger, IManageConfigValues $config, string $basepath) { $this->logger = $logger; - $this->mode = $mode; $this->config = $config; $this->basePath = $basepath; } @@ -112,6 +106,12 @@ class System */ public function isMinMemoryReached(): bool { + // Deactivated, needs more investigating if this check really makes sense + return false; + + /* + * Commented out to suppress static analyzer issues + * $min_memory = $this->config->get('system', 'min_memory', 0); if ($min_memory == 0) { return false; @@ -147,6 +147,7 @@ class System } return $reached; + */ } /** @@ -156,24 +157,15 @@ class System */ public function isMaxLoadReached(): bool { - if ($this->mode->isBackend()) { - $process = 'backend'; - $maxsysload = intval($this->config->get('system', 'maxloadavg')); - if ($maxsysload < 1) { - $maxsysload = 50; - } - } else { - $process = 'frontend'; - $maxsysload = intval($this->config->get('system', 'maxloadavg_frontend')); - if ($maxsysload < 1) { - $maxsysload = 50; - } + $maxsysload = intval($this->config->get('system', 'maxloadavg')); + if ($maxsysload < 1) { + $maxsysload = 50; } $load = System::currentLoad(); if ($load) { if (intval($load) > $maxsysload) { - $this->logger->warning('system load for process too high.', ['load' => $load, 'process' => $process, 'maxsysload' => $maxsysload]); + $this->logger->warning('system load for process too high.', ['load' => $load, 'process' => 'backend', 'maxsysload' => $maxsysload]); return true; } }