diff --git a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py index ac8d27a..ac887e0 100644 --- a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py @@ -872,10 +872,11 @@ class TomoQueueMixin: Raises: TomoQueueError: ``job_index`` is out of range, the job at that - index is a command job (not a tomo scan), or some *other* + index is a command job (not a tomo scan), or some *earlier* job in the queue is already "incomplete"/"running" (the queue's single-resumable-job invariant -- resolve that one - first, or pass its own index). + first, or pass its own index). A later job in this state is + not a conflict -- it gets reset to "pending" below anyway. ValueError: ``projection_number`` is out of range for this job's own tomo scan parameters. """ @@ -890,8 +891,8 @@ class TomoQueueMixin: "command job, not a tomo scan -- nothing to reacquire." ) - for idx, other in enumerate(jobs): - if idx != job_index and other.get("status") in ("incomplete", "running"): + for idx, other in enumerate(jobs[:job_index]): + if other.get("status") in ("incomplete", "running"): raise TomoQueueError( f"tomo_queue_reacquire: job #{idx} ('{other['label']}') is already " f"'{other['status']}' -- resolve it first (or pass index {idx} "