From 05a488a7a0c8d3d7d2faad0db714d413973e17db Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 27 Dec 2021 17:15:30 +0100 Subject: [PATCH] Further reduce log verbosity for kucoin 429000 exception --- freqtrade/exchange/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/common.py b/freqtrade/exchange/common.py index 2643cd499..5bb7f348c 100644 --- a/freqtrade/exchange/common.py +++ b/freqtrade/exchange/common.py @@ -82,7 +82,7 @@ def retrier_async(f): except TemporaryError as ex: msg = f'{f.__name__}() returned exception: "{ex}". ' if count > 0: - logger.warning(msg + f'Retrying still for {count} times.') + msg += f'Retrying still for {count} times.' count -= 1 kwargs['count'] = count if isinstance(ex, DDosProtection): @@ -92,10 +92,14 @@ def retrier_async(f): log_once_warning( f"Kucoin 429 error, avoid triggering DDosProtection backoff delay. " f"{count} tries left before giving up") + # Reset msg to avoid logging too many times. + msg = '' else: backoff_delay = calculate_backoff(count + 1, API_RETRY_COUNT) logger.info(f"Applying DDosProtection backoff delay: {backoff_delay}") await asyncio.sleep(backoff_delay) + if msg: + logger.warning(msg) return await wrapper(*args, **kwargs) else: logger.warning(msg + 'Giving up.')