Skip to content

Commit 4730183

Browse files
committed
fix: be more selective before activating parallel download
1 parent b7b280d commit 4730183

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

freqtrade/data/history/history_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,20 @@ def _download_all_pairs_history_parallel(
474474
:return: Candle pairs with timeframes
475475
"""
476476
candles: dict[PairWithTimeframe, DataFrame] = {}
477-
since = 0
477+
since: int | None = None
478478
if timerange:
479479
if timerange.starttype == "date":
480480
since = timerange.startts * 1000
481481

482482
candle_limit = exchange.ohlcv_candle_limit(timeframe, candle_type)
483483
one_call_min_time_dt = dt_ts(date_minus_candles(timeframe, candle_limit))
484484
# check if we can get all candles in one go, if so then we can download them in parallel
485-
if since > one_call_min_time_dt:
485+
if since is None or since > one_call_min_time_dt:
486486
logger.info(
487-
f"Downloading parallel candles for {timeframe} for all pairs "
488-
f"since {format_ms_time(since)}"
487+
f"Downloading parallel candles for {timeframe} for all pairs"
488+
f" since {format_ms_time(since)}"
489+
if since
490+
else "."
489491
)
490492
needed_pairs: ListPairsWithTimeframes = [
491493
(p, timeframe, candle_type) for p in [p for p in pairs]

0 commit comments

Comments
 (0)