*/
private $pid;
- public function __construct(LoggerInterface $logger, App\Mode $mode, IConfig $config, Model\Process $processModel, string $basepath)
+ public function __construct(LoggerInterface $logger, App\Mode $mode, IConfig $config, Model\Process $processModel, string $basepath, int $pid)
{
$this->logger = $logger;
$this->mode = $mode;
$this->config = $config;
$this->basePath = $basepath;
$this->processModel = $processModel;
- $this->pid = getmypid();
+ $this->pid = $pid;
}
/**
$args = ['no_cron' => !$do_cron];
$a = DI::app();
- $process = new Core\Process(DI::logger(), DI::mode(), DI::config(), $a->getBasePath());
+ $process = new Core\Process(DI::logger(), DI::mode(), DI::config(), DI::modelProcess(), $a->getBasePath(), getmypid());
$process->run($command, $args);
// after spawning we have to remove the flag.