From 594b1a75b567337e4fac13947c846723298fa87d Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Jan 2021 21:48:29 +0000 Subject: [PATCH] Use the correct pid --- src/Core/Worker.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 54bfdedf3..504a7b9f5 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -1232,6 +1232,8 @@ class Worker } // We now are in the new worker + $pid = getmypid(); + DBA::connect(); /// @todo Reinitialize the logger to set a new process_id and uid DI::process()->setPid($pid); @@ -1241,15 +1243,15 @@ class Worker usleep(10000); } - Logger::info('Worker spawned', ['pid' => getmypid(), 'wait_cycles' => $cycles]); + Logger::info('Worker spawned', ['pid' => $pid, 'wait_cycles' => $cycles]); self::processQueue($do_cron); self::unclaimProcess(); - self::IPCSetJobState(false, getmypid()); + self::IPCSetJobState(false, $pid); DI::process()->end(); - Logger::info('Worker ended', ['pid' => getmypid()]); + Logger::info('Worker ended', ['pid' => $pid]); exit(); }