Commit f5abd777 authored by Alejandro Alvarez Ayllon's avatar Alejandro Alvarez Ayllon
Browse files

Try optimize query to cancel by user_dn

parent 02d19fd5
Pipeline #77591 passed with stage
in 22 seconds
......@@ -157,7 +157,9 @@ def _cancel_jobs(dn):
Cancel all jobs that belong to dn.
Returns the list of affected jobs ids.
jobs = Session.query(Job.job_id).filter(Job.job_state.in_(JobActiveStates)).filter(Job.user_dn == dn)
jobs = Session.query(Job.job_id).filter(
Job.job_state.in_(JobActiveStates), Job.user_dn == dn, Job.job_finished == None
job_ids = map(lambda j: j[0], jobs)
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