add lock to any historic data access
This commit is contained in:
parent
3c2e314ee5
commit
4b26b6aaec
@ -858,14 +858,16 @@ class FreqaiDataKitchen:
|
||||
dataframe: DataFrame = strategy provided dataframe
|
||||
"""
|
||||
|
||||
history_data = self.data_drawer.historic_data
|
||||
with self.data_drawer.history_lock:
|
||||
history_data = self.data_drawer.historic_data
|
||||
|
||||
for pair in self.all_pairs:
|
||||
for tf in self.freqai_config.get('timeframes'):
|
||||
lh = len(history_data[pair][tf].index)
|
||||
history_data[pair][tf].loc[lh] = strategy.dp.get_pair_dataframe(pair, tf).iloc[-1]
|
||||
for pair in self.all_pairs:
|
||||
for tf in self.freqai_config.get('timeframes'):
|
||||
lh = len(history_data[pair][tf].index)
|
||||
history_data[pair][tf].loc[lh] = strategy.dp.get_pair_dataframe(pair,
|
||||
tf).iloc[-1]
|
||||
|
||||
logger.info(f'Length of history data {len(history_data[pair][tf])}')
|
||||
logger.info(f'Length of history data {len(history_data[pair][tf])}')
|
||||
|
||||
def set_all_pairs(self) -> None:
|
||||
|
||||
|
@ -405,8 +405,9 @@ class IFreqaiModel(ABC):
|
||||
# dh.download_new_data_for_retraining(data_load_timerange, metadata, strategy)
|
||||
# corr_dataframes, base_dataframes = dh.load_pairs_histories(data_load_timerange,
|
||||
# metadata)
|
||||
corr_dataframes, base_dataframes = dh.get_base_and_corr_dataframes(data_load_timerange,
|
||||
metadata)
|
||||
with self.data_drawer.history_lock:
|
||||
corr_dataframes, base_dataframes = dh.get_base_and_corr_dataframes(data_load_timerange,
|
||||
metadata)
|
||||
|
||||
# protecting from common benign errors associated with grabbing new data from exchange:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user