Skip to content

Commit

Permalink
Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Nov 7, 2024
1 parent 18955a1 commit 25a8202
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -1905,9 +1905,7 @@ public static function stopAll(int $code = 0, mixed $log = ''): void
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);
Expand Down Expand Up @@ -2445,12 +2443,6 @@ public function stop(): void
$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;
Expand Down

0 comments on commit 25a8202

Please sign in to comment.