From 4f1c8209a024cd3792659d02114a8f219971e1a3 Mon Sep 17 00:00:00 2001 From: Peter Weidauer Date: Tue, 2 Jan 2018 15:58:12 +0000 Subject: [PATCH] Do not attempt to reconnect channels if there is no connection --- aio_pika/robust_connection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aio_pika/robust_connection.py b/aio_pika/robust_connection.py index bd08684d..3d02346f 100644 --- a/aio_pika/robust_connection.py +++ b/aio_pika/robust_connection.py @@ -94,10 +94,10 @@ def _on_connection_lost(self, future: asyncio.Future, connection: AsyncioConnect def connect(self): result = yield from super().connect() - for number, channel in self._channels.items(): - yield from channel.on_reconnect(self, number) - if self._connection: + for number, channel in self._channels.items(): + yield from channel.on_reconnect(self, number) + for callback in self._on_reconnect_callbacks: callback(self)