Fix: shutil import was inside finally block, causing NameError when shutil.move was called
This commit is contained in:
+6
-1
@@ -119,12 +119,17 @@ def run_subprocess_logged(cmd, job_id, step_name):
|
||||
update_job(job_id, current_step=step_name, status="processing")
|
||||
proc = subprocess.run(cmd, capture_output=True, text=True)
|
||||
if proc.returncode != 0:
|
||||
# Combine stdout + stderr za diagnostiko
|
||||
err_msg = (proc.stderr or "") + "\n" + (proc.stdout or "")
|
||||
update_job(
|
||||
job_id,
|
||||
status="failed",
|
||||
error=f"{step_name}: {proc.stderr[-500:]}",
|
||||
error=f"{step_name}: {err_msg[-800:].strip()}",
|
||||
)
|
||||
return False
|
||||
# Tudi pri success-u beleži stderr za diagnostiko (samo zadnji del)
|
||||
if proc.stderr and proc.stderr.strip():
|
||||
update_job(job_id, last_step_log=proc.stderr[-500:].strip())
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user