Parcourir la source

Avoid a problem which caused by docker always use a same pid

Garveen il y a 9 ans
Parent
commit
fb170aadd1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Worker.php

+ 1 - 1
Worker.php

@@ -611,7 +611,7 @@ class Worker
         $master_is_alive = $master_pid && @posix_kill($master_pid, 0);
         // Master is still alive?
         if ($master_is_alive) {
-            if ($command === 'start') {
+            if ($command === 'start' && posix_getpid() != $master_pid) {
                 self::log("Workerman[$start_file] already running");
                 exit;
             }