From 5bed2a8f983a3bf61c12443e7704ffd89991ef9a Mon Sep 17 00:00:00 2001 From: Lemon Shi Date: Sat, 22 Jan 2022 11:40:38 +0000 Subject: [PATCH] The times of retrying is not correct The times of retrying was 'max_retries' plus 1 which is fixed now. --- kombu/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kombu/connection.py b/kombu/connection.py index 4b2cbd62..3ad84645 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -529,7 +529,7 @@ class Connection: # the error if it persists after a new connection # was successfully established. raise - if max_retries is not None and retries > max_retries: + if max_retries is not None and retries >= max_retries: raise self._debug('ensure connection error: %r', exc, exc_info=1)