mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 11:51:19 +00:00
fix: be more selective before activating parallel download
This commit is contained in:
@@ -474,7 +474,7 @@ def _download_all_pairs_history_parallel(
|
|||||||
:return: Candle pairs with timeframes
|
:return: Candle pairs with timeframes
|
||||||
"""
|
"""
|
||||||
candles: dict[PairWithTimeframe, DataFrame] = {}
|
candles: dict[PairWithTimeframe, DataFrame] = {}
|
||||||
since = 0
|
since: int | None = None
|
||||||
if timerange:
|
if timerange:
|
||||||
if timerange.starttype == "date":
|
if timerange.starttype == "date":
|
||||||
since = timerange.startts * 1000
|
since = timerange.startts * 1000
|
||||||
@@ -482,10 +482,12 @@ def _download_all_pairs_history_parallel(
|
|||||||
candle_limit = exchange.ohlcv_candle_limit(timeframe, candle_type)
|
candle_limit = exchange.ohlcv_candle_limit(timeframe, candle_type)
|
||||||
one_call_min_time_dt = dt_ts(date_minus_candles(timeframe, candle_limit))
|
one_call_min_time_dt = dt_ts(date_minus_candles(timeframe, candle_limit))
|
||||||
# check if we can get all candles in one go, if so then we can download them in parallel
|
# check if we can get all candles in one go, if so then we can download them in parallel
|
||||||
if since > one_call_min_time_dt:
|
if since is None or since > one_call_min_time_dt:
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Downloading parallel candles for {timeframe} for all pairs "
|
f"Downloading parallel candles for {timeframe} for all pairs"
|
||||||
f"since {format_ms_time(since)}"
|
f" since {format_ms_time(since)}"
|
||||||
|
if since
|
||||||
|
else "."
|
||||||
)
|
)
|
||||||
needed_pairs: ListPairsWithTimeframes = [
|
needed_pairs: ListPairsWithTimeframes = [
|
||||||
(p, timeframe, candle_type) for p in [p for p in pairs]
|
(p, timeframe, candle_type) for p in [p for p in pairs]
|
||||||
|
|||||||
Reference in New Issue
Block a user