Better exchange logging

This commit is contained in:
hroff-1902 2020-05-31 13:05:58 +03:00
parent b1e6662c11
commit 123a556ec8

View File

@ -887,14 +887,20 @@ class Exchange:
Async wrapper handling downloading trades using either time or id based methods.
"""
logger.debug(f"_async_get_trade_history(), pair: {pair}, "
f"since: {since}, until: {until}, from_id: {from_id}")
if not until:
exchange_msec = ccxt.Exchange.milliseconds()
logger.debug(f"Exchange milliseconds: {exchange_msec}")
until = exchange_msec
if self._trades_pagination == 'time':
return await self._async_get_trade_history_time(
pair=pair, since=since,
until=until or ccxt.Exchange.milliseconds())
pair=pair, since=since, until=until)
elif self._trades_pagination == 'id':
return await self._async_get_trade_history_id(
pair=pair, since=since,
until=until or ccxt.Exchange.milliseconds(), from_id=from_id
pair=pair, since=since, until=until, from_id=from_id
)
else:
raise OperationalException(f"Exchange {self.name} does use neither time, "