MCPcopy Create free account
hub / github.com/ccxt/ccxt / safe_deterministic_call

Method safe_deterministic_call

python/ccxt/base/exchange.py:7642–7658  ·  view source on GitHub ↗
(self, method: str, symbol: Str = None, since: Int = None, limit: Int = None, timeframe: Str = None, params={})

Source from the content-addressed store, hash-verified

7640 return self.filter_by_since_limit(sortedRes, since, limit, key)
7641
7642 def safe_deterministic_call(self, method: str, symbol: Str = None, since: Int = None, limit: Int = None, timeframe: Str = None, params={}):
7643 maxRetries = None
7644 maxRetries, params = self.handle_option_and_params(params, method, 'maxRetries', 3)
7645 errors = 0
7646 while(errors <= maxRetries):
7647 try:
7648 if timeframe and method != 'fetchFundingRateHistory':
7649 return getattr(self, method)(symbol, timeframe, since, limit, params)
7650 else:
7651 return getattr(self, method)(symbol, since, limit, params)
7652 except Exception as e:
7653 if isinstance(e, RateLimitExceeded):
7654 raise e # if we are rate limited, we should not retry and fail fast
7655 errors += 1
7656 if errors > maxRetries:
7657 raise e
7658 return []
7659
7660 def fetch_paginated_call_deterministic(self, method: str, symbol: Str = None, since: Int = None, limit: Int = None, timeframe: Str = None, params={}, maxEntriesPerRequest: Int = None):
7661 maxCalls = None

Callers 1

Calls 1

Tested by

no test coverage detected