Skip to content

Commit

Permalink
Reload method early return
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Apr 10, 2024
1 parent 4431adb commit ee590bb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/WorkerProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ final public function stop(int $code = self::STOP_EXIT_CODE): void

final public function reload(): void
{
if ($this->isReloadable()) {
$this->exitCode = self::RELOAD_EXIT_CODE;
try {
$this->onReload !== null && ($this->onReload)($this);
} finally {
$this->eventLoop->stop();
}
if (!$this->isReloadable()) {
return;
}

$this->exitCode = self::RELOAD_EXIT_CODE;
try {
$this->onReload !== null && ($this->onReload)($this);
} finally {
$this->eventLoop->stop();
}
}

Expand Down

0 comments on commit ee590bb

Please sign in to comment.