Jelajahi Sumber

Optimizations

walkor 1 tahun lalu
induk
melakukan
25a820205c
1 mengubah file dengan 0 tambahan dan 8 penghapusan
  1. 0 8
      src/Worker.php

+ 0 - 8
src/Worker.php

@@ -1905,9 +1905,7 @@ class Worker
             array_walk($workers, static fn (Worker $worker) => $worker->stop());
 
             if (!static::getGracefulStop() || ConnectionInterface::$statistics['connection_count'] <= 0) {
-                static::$workers = [];
                 static::$globalEvent?->stop();
-
                 try {
                     // Ignore Swoole ExitException: Swoole exit.
                     exit($code);
@@ -2445,12 +2443,6 @@ 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;
         $this->stopping  = true;