walkor 2 лет назад
Родитель
Сommit
3033d668ca
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      src/Worker.php

+ 6 - 3
src/Worker.php

@@ -1511,9 +1511,6 @@ class Worker
             \srand();
             \mt_srand();
             static::$gracefulStop = false;
-            if ($worker->reusePort) {
-                $worker->listen();
-            }
             if (static::$status === static::STATUS_STARTING) {
                 static::resetStd();
             }
@@ -2441,6 +2438,12 @@ class Worker
                 $connection->close();
             }
         }
+        // Remove worker.
+        foreach(static::$workers as $key => $one_worker) {
+            if ($one_worker->workerId === $this->workerId) {
+                unset(static::$workers[$key]);
+            }
+        }
         // Clear callback.
         $this->onMessage = $this->onClose = $this->onError = $this->onBufferDrain = $this->onBufferFull = null;
     }