diff --git a/src/Core/Process.php b/src/Core/Process.php index 08284b211..f8958f102 100644 --- a/src/Core/Process.php +++ b/src/Core/Process.php @@ -67,14 +67,14 @@ class Process */ 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; } /** diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 80ec16982..c586310b7 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -1172,7 +1172,7 @@ class Worker $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. diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 3df54b79e..b1a54786a 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -187,6 +187,7 @@ return [ Process::class => [ 'constructParams' => [ [Dice::INSTANCE => '$basepath'], + getmypid(), ], ], App\Router::class => [