From b5fd11f91b265d65fb4c9485794368169037be3b Mon Sep 17 00:00:00 2001 From: robcaulk Date: Mon, 19 Sep 2022 20:39:19 +0200 Subject: [PATCH] protect against unforeseen issues in scanning thread --- freqtrade/freqai/freqai_interface.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 156c6bee5..5850cdeb3 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -205,9 +205,13 @@ class IFreqaiModel(ABC): if retrain: self.train_timer('start') - self.extract_data_and_train_model( - new_trained_timerange, pair, strategy, dk, data_load_timerange - ) + try: + self.extract_data_and_train_model( + new_trained_timerange, pair, strategy, dk, data_load_timerange + ) + except Exception as msg: + logger.warning(f'Training {pair} raised exception {msg}, skipping.') + self.train_timer('stop') # only rotate the queue after the first has been trained.