*/
private $logger;
- /**
- * @var App\Mode
- */
- private $mode;
-
/**
* @var IManageConfigValues
*/
*/
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;
}
*/
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;
}
return $reached;
+ */
}
/**
*/
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;
}
}
$this->logger->warning('We got no resource for command.', ['command' => $cmdline]);
return;
}
+
proc_close($resource);
$this->logger->info('Executed "proc_open"', ['command' => $cmdline, 'callstack' => System::callstack(10)]);