move "since" fallback to be the last check
This commit is contained in:
@@ -357,9 +357,6 @@ def _download_trades_history(exchange: Exchange,
|
|||||||
f"available data. Redownloading trades for {pair}...")
|
f"available data. Redownloading trades for {pair}...")
|
||||||
trades = trades_list_to_df([])
|
trades = trades_list_to_df([])
|
||||||
|
|
||||||
if not since:
|
|
||||||
since = dt_ts(dt_now() - timedelta(days=new_pairs_days))
|
|
||||||
|
|
||||||
from_id = trades.iloc[-1]['id'] if not trades.empty else None
|
from_id = trades.iloc[-1]['id'] if not trades.empty else None
|
||||||
if not trades.empty and since < trades.iloc[-1]['timestamp']:
|
if not trades.empty and since < trades.iloc[-1]['timestamp']:
|
||||||
# Reset since to the last available point
|
# Reset since to the last available point
|
||||||
@@ -368,6 +365,9 @@ def _download_trades_history(exchange: Exchange,
|
|||||||
logger.info(f"Using last trade date -5s - Downloading trades for {pair} "
|
logger.info(f"Using last trade date -5s - Downloading trades for {pair} "
|
||||||
f"since: {format_ms_time(since)}.")
|
f"since: {format_ms_time(since)}.")
|
||||||
|
|
||||||
|
if not since:
|
||||||
|
since = dt_ts(dt_now() - timedelta(days=new_pairs_days))
|
||||||
|
|
||||||
logger.debug("Current Start: %s", 'None' if trades.empty else
|
logger.debug("Current Start: %s", 'None' if trades.empty else
|
||||||
f"{trades.iloc[0]['date']:{DATETIME_PRINT_FORMAT}}")
|
f"{trades.iloc[0]['date']:{DATETIME_PRINT_FORMAT}}")
|
||||||
logger.debug("Current End: %s", 'None' if trades.empty else
|
logger.debug("Current End: %s", 'None' if trades.empty else
|
||||||
|
|||||||
Reference in New Issue
Block a user