]> git.mxchange.org Git - friendica.git/commitdiff
Set the new pid
authorMichael <heluecht@pirati.ca>
Tue, 5 Jan 2021 21:39:53 +0000 (21:39 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 5 Jan 2021 21:39:53 +0000 (21:39 +0000)
src/Core/Process.php
src/Core/Worker.php

index 919d37dea1faacad4469cb03ed4d375c7ec1bc77..447d312d44d3e20bc152d85d1f761c52b5a2c55f 100644 (file)
@@ -77,6 +77,17 @@ class Process
                $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
         */
index d2468a2a804bf1f427108a48f9f196c0cae03fb9..54bfdedf3ef0df4ea2a6f4a0feedbaabe8080f05 100644 (file)
@@ -1234,6 +1234,7 @@ class Worker
                // We now are in the new worker
                DBA::connect();
                /// @todo Reinitialize the logger to set a new process_id and uid
+               DI::process()->setPid($pid);
 
                $cycles = 0;
                while (!self::IPCJobsExists($pid) && (++$cycles < 100)) {