chore: Implement safeguard against non-existing strategy files

This commit is contained in:
Matthias
2025-03-24 06:41:58 +01:00
parent 286371c1e4
commit 1fdce89806

View File

@@ -95,6 +95,9 @@ def store_backtest_results(
# Store the strategy file and its parameters
strategy_buf = BytesIO()
strategy_path = Path(strategy_file)
if not strategy_path.is_file():
logger.warning(f"Strategy file '{strategy_path}' does not exist. Skipping.")
continue
with strategy_path.open("rb") as strategy_file_obj:
strategy_buf.write(strategy_file_obj.read())
strategy_buf.seek(0)