]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/System.php
Merge pull request #11015 from MrPetovan/task/10979-frio-time-tooltip
[friendica.git] / src / Core / System.php
index 44249175a72341540ace92e1bb6294dacc70779e..44512390617e53008b859e1f229b159c7abf566a 100644 (file)
@@ -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;
                        }
                }