Skip to content

Commit

Permalink
shutdown with the first error
Browse files Browse the repository at this point in the history
  • Loading branch information
hsldymq committed Mar 28, 2019
1 parent 32105c3 commit d89a76a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,12 @@ public function shutdown(\Throwable $withError = null)
return;
}

$this->connection->disconnect()->always(function () use ($withError) {
if ($withError && !$this->shutdownError) {
$this->shutdownError = $withError;
}

$this->connection->disconnect()->always(function () {
$this->state = self::STATE_FLUSHING;
$withError && $this->shutdownError = $withError;
$this->stopProcess();
});
}
Expand Down

0 comments on commit d89a76a

Please sign in to comment.