Spaces:
Running
Running
Log expected analysis cancellation without traceback
Browse files
app.py
CHANGED
|
@@ -535,7 +535,10 @@ def run_job(client_id, work, cameras):
|
|
| 535 |
job.update(status=status, phase="Sync failed" if saved else status.capitalize(), stage="done" if status in {"cancelled", "failed"} else "saving", error="Files saved; retry backend sync" if saved else "Analysis cancelled" if status == "cancelled" else "Analysis or saving failed")
|
| 536 |
if saved:
|
| 537 |
job["status"] = "failed"
|
| 538 |
-
|
|
|
|
|
|
|
|
|
|
| 539 |
try:
|
| 540 |
if not saved:
|
| 541 |
backend(f"/{session_id}", job.get("ownerUserId") or job["userId"], "PUT", {"status": status}, is_admin=job.get("actorIsAdmin", False))
|
|
|
|
| 535 |
job.update(status=status, phase="Sync failed" if saved else status.capitalize(), stage="done" if status in {"cancelled", "failed"} else "saving", error="Files saved; retry backend sync" if saved else "Analysis cancelled" if status == "cancelled" else "Analysis or saving failed")
|
| 536 |
if saved:
|
| 537 |
job["status"] = "failed"
|
| 538 |
+
if status == "cancelled":
|
| 539 |
+
logger.info("Session %s cancelled", session_id)
|
| 540 |
+
else:
|
| 541 |
+
logger.exception("Session %s %s", session_id, status)
|
| 542 |
try:
|
| 543 |
if not saved:
|
| 544 |
backend(f"/{session_id}", job.get("ownerUserId") or job["userId"], "PUT", {"status": status}, is_admin=job.get("actorIsAdmin", False))
|