We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b8cd955 + ba90669 commit b713b99Copy full SHA for b713b99
1 file changed
src/Queue/Broker/AMQP.php
@@ -189,15 +189,16 @@ private function withChannel(callable $callback): void
189
return $channel;
190
};
191
192
- if ($this->channel == null) {
+ if (!$this->channel) {
193
$this->channel = $createChannel();
194
}
195
196
try {
197
$callback($this->channel);
198
} catch (\Throwable $th) {
199
- // try to create a new connection once
200
- unset($this->channel);
+ // createChannel() might throw, in that case set the channel to `null` first.
+ $this->channel = null;
201
+ // try creating a new connection once, if this still fails, throw the error
202
203
204
0 commit comments