Evict cache if parameter file changed

closes #6735
This commit is contained in:
Matthias 2022-04-29 19:44:17 +02:00
parent fbd142844f
commit 43049e0465

View File

@ -26,7 +26,9 @@ def get_strategy_run_id(strategy) -> str:
# as it does not matter for getting the hash. # as it does not matter for getting the hash.
digest.update(rapidjson.dumps(config, default=str, digest.update(rapidjson.dumps(config, default=str,
number_mode=rapidjson.NM_NAN).encode('utf-8')) number_mode=rapidjson.NM_NAN).encode('utf-8'))
# Include _ft_params_from_file - so changing parameter files cause cache eviction
digest.update(rapidjson.dumps(
strategy._ft_params_from_file, default=str, number_mode=rapidjson.NM_NAN).encode('utf-8'))
with open(strategy.__file__, 'rb') as fp: with open(strategy.__file__, 'rb') as fp:
digest.update(fp.read()) digest.update(fp.read())
return digest.hexdigest().lower() return digest.hexdigest().lower()