@@ -140,7 +140,7 @@ async def _try_finalize_execution(self, execution: ExecutionInDB) -> Optional[Ex
140140 # average CPU in millicores: (CPU-seconds / wall-seconds) × 1000
141141 cpu_millicores = (cpu_s / wall_s * 1000 ) if wall_s else 0.0
142142
143- # VmHWM is k *ibi*bytes → MiB = KiB / 1024
143+ # VmHWM is k*ibi*bytes → MiB = KiB / 1024
144144 peak_kib = float (res_usage .get ("peak_memory_kb" , 0 ) or 0 )
145145 peak_mib = peak_kib / 1024.0
146146
@@ -152,21 +152,12 @@ async def _try_finalize_execution(self, execution: ExecutionInDB) -> Optional[Ex
152152
153153 final_resource_usage ["pod_phase" ] = final_phase
154154
155- if exit_code == 0 :
156- update_data = {
157- "status" : ExecutionStatus .COMPLETED ,
158- "output" : metrics .get ("stdout" , "" ),
159- "errors" : None ,
160- "resource_usage" : final_resource_usage ,
161- }
162- else :
163- error_details = metrics .get ("stderr" ) or f"Script failed with exit code { exit_code } ."
164- update_data = {
165- "status" : ExecutionStatus .ERROR ,
166- "output" : metrics .get ("stdout" , "" ),
167- "errors" : error_details ,
168- "resource_usage" : final_resource_usage ,
169- }
155+ update_data = {
156+ "status" : ExecutionStatus .COMPLETED if exit_code == 0 else ExecutionStatus .ERROR ,
157+ "output" : metrics .get ("stdout" , "" ),
158+ "errors" : metrics .get ("stderr" , "" ),
159+ "resource_usage" : final_resource_usage ,
160+ }
170161
171162 logger .info (f"Finalizing execution { execution .id } with status: { update_data .get ('status' , 'unknown' )} " )
172163 update_payload = ExecutionUpdate (** update_data ).model_dump (exclude_unset = True )
0 commit comments