After-Failure-Repair Optimization