run_iso_build: nie mehr still auf status=running haengen bleiben
This commit is contained in:
1 parent
16441a2410
commit
81bda7c25e
1 file changed
+20
-7
@@ -2510,14 +2510,27 @@ def run_iso_build(build_id, organization_id: str, activation_code: str, wifi_ssi
|
||||
update_iso_build(build_id, status="failed", error_message=error_tail, mark_finished=True)
|
||||
return
|
||||
|
||||
sha256 = compute_file_sha256(output_path)
|
||||
size_bytes = output_path.stat().st_size
|
||||
# Eigener try/except (08.09.2026 ergaenzt, echter Bug): ohne das blieb
|
||||
# der Build-Datensatz bei JEDEM Fehler ab hier (z.B. output_path war
|
||||
# nach dem De-Root-Umzug root-eigen und fuer diesen unprivilegierten
|
||||
# Prozess unlesbar) fuer immer auf status="running" haengen - eine
|
||||
# unbehandelte Exception in einem Python-Thread beendet nur den
|
||||
# Thread, nicht den Prozess, und ruft nie update_iso_build() auf. Siehe
|
||||
# auch den chown-Fix in build_customer_iso.sh fuer die konkrete Ursache
|
||||
# dieses einen Falls - dieser try/except bleibt trotzdem sinnvoll als
|
||||
# genereller Schutz gegen jeden aehnlichen kuenftigen Fehler hier.
|
||||
try:
|
||||
sha256 = compute_file_sha256(output_path)
|
||||
size_bytes = output_path.stat().st_size
|
||||
|
||||
update_iso_build(
|
||||
build_id, status="completed", output_filename=output_path.name, sha256=sha256,
|
||||
size_bytes=size_bytes, mark_finished=True
|
||||
)
|
||||
cleanup_old_iso_builds(organization_id, build_id)
|
||||
update_iso_build(
|
||||
build_id, status="completed", output_filename=output_path.name, sha256=sha256,
|
||||
size_bytes=size_bytes, mark_finished=True
|
||||
)
|
||||
cleanup_old_iso_builds(organization_id, build_id)
|
||||
except Exception as exc:
|
||||
output_path.unlink(missing_ok=True)
|
||||
update_iso_build(build_id, status="failed", error_message=str(exc)[:4000], mark_finished=True)
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
|
||||
Reference in new issue
Block a user