Add static workaround for kucoin 429000 issue

closes #5700
This commit is contained in:
Stefano Ariestasia 2021-06-14 14:39:12 +09:00 committed by Matthias
parent 37d461c6c2
commit 632c1bc0aa

View File

@ -81,9 +81,16 @@ def retrier_async(f):
count -= 1 count -= 1
kwargs.update({'count': count}) kwargs.update({'count': count})
if isinstance(ex, DDosProtection): if isinstance(ex, DDosProtection):
backoff_delay = calculate_backoff(count + 1, API_RETRY_COUNT) if "kucoin" in str(ex) and "429000" in str(ex):
logger.info(f"Applying DDosProtection backoff delay: {backoff_delay}") # Temporary fix for 429000 error on kucoin
await asyncio.sleep(backoff_delay) # see https://github.com/freqtrade/freqtrade/issues/5700 for details.
logger.warning(
f"Kucoin 429 error, avoid triggering DDosProtection backoff delay. "
f"{count} tries left before giving up")
else:
backoff_delay = calculate_backoff(count + 1, API_RETRY_COUNT)
logger.info(f"Applying DDosProtection backoff delay: {backoff_delay}")
await asyncio.sleep(backoff_delay)
return await wrapper(*args, **kwargs) return await wrapper(*args, **kwargs)
else: else:
logger.warning('Giving up retrying: %s()', f.__name__) logger.warning('Giving up retrying: %s()', f.__name__)