Refactor refresh_pairs to exchange and fix tests

This commit is contained in:
Matthias
2018-08-16 12:15:09 +02:00
parent e6e2799f03
commit ff8ed564f1
4 changed files with 39 additions and 47 deletions

View File

@@ -389,6 +389,16 @@ class Exchange(object):
logger.info("downloaded %s with length %s.", pair, len(data))
return data
def refresh_tickers(self, pair_list: List[str], ticker_interval: str) -> bool:
"""
Refresh tickers asyncronously and return the result.
"""
logger.debug("Refreshing klines for %d pairs", len(pair_list))
asyncio.get_event_loop().run_until_complete(
self.async_get_candles_history(pair_list, ticker_interval))
return True
async def async_get_candles_history(self, pairs: List[str],
tick_interval: str) -> List[Tuple[str, List]]:
"""Download ohlcv history for pair-list asyncronously """