diff options
author | Oleh Kuchuk <kuchuklehjs@gmail.com> | 2020-04-15 15:16:57 +0300 |
---|---|---|
committer | Asif Saif Uddin <auvipy@gmail.com> | 2020-04-15 21:08:18 +0600 |
commit | 90f51bcbbd32146998e7c7e4491150344343776b (patch) | |
tree | 250034eaff1395331adb7548aebf7ae0f8313536 /kombu | |
parent | 472101103e5ead37ad637beb7361aa1b3a32e389 (diff) | |
download | kombu-90f51bcbbd32146998e7c7e4491150344343776b.tar.gz |
Raise RecoverableConnectionError in maybe_declare with retry on and dropped connection
Diffstat (limited to 'kombu')
-rw-r--r-- | kombu/common.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kombu/common.py b/kombu/common.py index 30abe1c6..8c2c847d 100644 --- a/kombu/common.py +++ b/kombu/common.py @@ -168,6 +168,10 @@ def _maybe_declare(entity, channel): def _imaybe_declare(entity, channel, **retry_policy): _ensure_channel_is_bound(entity, channel) + + if not channel.connection: + raise RecoverableConnectionError('channel disconnected') + return entity.channel.connection.client.ensure( entity, _maybe_declare, **retry_policy)(entity, channel) |