<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
$this->pid = $pid;
}
+ /**
+ * Set the process id
+ *
+ * @param integer $pid
+ * @return void
+ */
+ public function setPid(int $pid)
+ {
+ $this->pid = $pid;
+ }
+
/**
* Log active processes into the "process" table
*/
$reached = ($free < $min_memory);
if ($reached) {
- $this->logger->debug('Minimal memory reached.', ['free' => $free, 'memtotal' => $meminfo['MemTotal'], 'limit' => $min_memory]);
+ $this->logger->warning('Minimal memory reached.', ['free' => $free, 'memtotal' => $meminfo['MemTotal'], 'limit' => $min_memory]);
}
return $reached;
$load = System::currentLoad();
if ($load) {
if (intval($load) > $maxsysload) {
- $this->logger->info('system load for process too high.', ['load' => $load, 'process' => $process, 'maxsysload' => $maxsysload]);
+ $this->logger->warning('system load for process too high.', ['load' => $load, 'process' => $process, 'maxsysload' => $maxsysload]);
return true;
}
}
public function run($command, $args)
{
if (!function_exists('proc_open')) {
- $this->logger->notice('"proc_open" not available - quitting');
+ $this->logger->warning('"proc_open" not available - quitting');
return;
}
}
if ($this->isMinMemoryReached()) {
- $this->logger->notice('Memory limit reached - quitting');
+ $this->logger->warning('Memory limit reached - quitting');
return;
}
$resource = proc_open($cmdline . ' &', [], $foo, $this->basePath);
}
if (!is_resource($resource)) {
- $this->logger->notice('We got no resource for command.', ['command' => $cmdline]);
+ $this->logger->warning('We got no resource for command.', ['command' => $cmdline]);
return;
}
proc_close($resource);