Skip to content

Commit 2429801

Browse files
committed
restore original code if not found for async
1 parent 7bcd136 commit 2429801

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ def optimize_function(self) -> Result[BestOptimization, str]:
424424
if self.args.override_fixtures:
425425
restore_conftest(original_conftest_content)
426426
if not best_optimization:
427+
self.write_code_and_helpers(
428+
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
429+
)
427430
return Failure(f"No best optimizations found for function {self.function_to_optimize.qualified_name}")
428431
return Success(best_optimization)
429432

0 commit comments

Comments
 (0)