Fix default behavior for expiration_hours

This commit is contained in:
Robert Caulk
2022-06-21 08:12:51 +02:00
committed by GitHub
parent b35c64b6c0
commit 852706cd6b

View File

@@ -737,7 +737,10 @@ class FreqaiDataKitchen:
time = datetime.datetime.now(tz=datetime.timezone.utc).timestamp()
elapsed_time = (time - trained_timestamp) / 3600 # hours
max_time = self.freqai_config.get('expiration_hours', 0)
if max_time > 0:
return elapsed_time > max_time
else:
return False
def check_if_new_training_required(self, trained_timestamp: int) -> Tuple[bool,
TimeRange, TimeRange]: