Prevent double job assignment

- Check if job is already assigned before assigning again
- Prevents multiple active jobs for the same queue entry
- Fixes duplicate cancellation attempts
parent ca9a9669
......@@ -1374,6 +1374,11 @@ class ClusterMaster:
for job_row in jobs:
job = dict(job_row)
# Check if already assigned
already_assigned = any(job_info.get('queue_id') == job['id'] for job_info in self.active_jobs.values())
if already_assigned:
continue
# Set status to processing before assigning
from .database import update_queue_status
update_queue_status(job['id'], 'processing')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment