Skip to content

Commit 78baf59

Browse files
committed
fix reconnect method
1 parent 0b6e302 commit 78baf59

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/Protocols/Amqp.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,18 @@ protected function reconnect(): bool
239239
$this->channel->close();
240240
}
241241

242+
if ($this->queues) {
243+
$queues = array_keys($this->queues);
244+
}
245+
242246
$this->connection->reconnect();
243247
$this->channel = new AMQPChannel($this->connection);
244248

245-
$this->clearSubscribes();
246-
foreach ($queues as $queue) {
247-
$this->subscribe($queue);
249+
if (isset($queues)) {
250+
$this->clearSubscribes();
251+
foreach ($queues as $queue) {
252+
$this->subscribe($queue);
253+
}
248254
}
249255

250256
return true;

0 commit comments

Comments
 (0)