From c9c43d2f0b6adc59811a292efe95448d411f1499 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 11 Aug 2020 15:27:41 +0200 Subject: [PATCH] Move log-message of retrying before decrementing count Otherwise the message is always one round "late". --- freqtrade/exchange/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/common.py b/freqtrade/exchange/common.py index 0610e8447..cbab742b7 100644 --- a/freqtrade/exchange/common.py +++ b/freqtrade/exchange/common.py @@ -107,9 +107,9 @@ def retrier_async(f): except TemporaryError as ex: logger.warning('%s() returned exception: "%s"', f.__name__, ex) if count > 0: + logger.warning('retrying %s() still for %s times', f.__name__, count) count -= 1 kwargs.update({'count': count}) - logger.warning('retrying %s() still for %s times', f.__name__, count) if isinstance(ex, DDosProtection): backoff_delay = calculate_backoff(count + 1, API_RETRY_COUNT) logger.debug(f"Applying DDosProtection backoff delay: {backoff_delay}") @@ -131,9 +131,9 @@ def retrier(_func=None, retries=API_RETRY_COUNT): except (TemporaryError, RetryableOrderError) as ex: logger.warning('%s() returned exception: "%s"', f.__name__, ex) if count > 0: + logger.warning('retrying %s() still for %s times', f.__name__, count) count -= 1 kwargs.update({'count': count}) - logger.warning('retrying %s() still for %s times', f.__name__, count) if isinstance(ex, DDosProtection) or isinstance(ex, RetryableOrderError): # increasing backoff backoff_delay = calculate_backoff(count + 1, retries)