Ensure 1 thread available

This commit is contained in:
Robert Caulk 2022-09-29 14:02:00 +02:00 committed by GitHub
parent 7ef56e3029
commit 6e74d46660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ class FreqaiDataKitchen:
self.data['extra_returns_per_train'] = self.freqai_config.get('extra_returns_per_train', {})
if not self.freqai_config.get("data_kitchen_thread_count", 0):
self.thread_count = int(psutil.cpu_count() * 2 - 2)
self.thread_count = max(int(psutil.cpu_count() * 2 - 2), 1)
else:
self.thread_count = self.freqai_config["data_kitchen_thread_count"]
self.train_dates: DataFrame = pd.DataFrame()