add reload argument

This commit is contained in:
iuvbio 2019-03-06 22:48:04 +01:00
parent 6b97af4a03
commit 041e9957dd

View File

@ -186,24 +186,23 @@ class Exchange(object):
"Please check your config.json") "Please check your config.json")
raise OperationalException(f'Exchange {name} does not provide a sandbox api') raise OperationalException(f'Exchange {name} does not provide a sandbox api')
def _load_async_markets(self) -> None: def _load_async_markets(self, reload=False) -> None:
try: try:
if self._api_async: if self._api_async:
asyncio.get_event_loop().run_until_complete(self._api_async.load_markets()) asyncio.get_event_loop().run_until_complete(
self._api_async.load_markets(reload=reload))
except ccxt.BaseError as e: except ccxt.BaseError as e:
logger.warning('Could not load async markets. Reason: %s', e) logger.warning('Could not load async markets. Reason: %s', e)
return return
def _load_markets(self) -> Dict[str, Any]: def _load_markets(self, reload=False) -> Dict[str, Any]:
""" Initialize markets both sync and async """ """ Initialize markets both sync and async """
try: try:
markets = self._api.load_markets() self._api.load_markets(reload=reload)
self._load_async_markets() self._load_async_markets(reload=reload)
return markets # prbly not necessary to return anything anymore
except ccxt.BaseError as e: except ccxt.BaseError as e:
logger.warning('Unable to initialize markets. Reason: %s', e) logger.warning('Unable to initialize markets. Reason: %s', e)
return {}
def validate_pairs(self, pairs: List[str]) -> None: def validate_pairs(self, pairs: List[str]) -> None:
""" """