Skip to content
Snippets Groups Projects
Commit 10ddc842 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-699: sort by group_id before updated_at

parent 3fa9713f
No related branches found
No related tags found
No related merge requests found
......@@ -610,7 +610,13 @@ class IngestJobManager:
if nrOfRunningJobsOnSourceHostA != nrOfRunningJobsOnSourceHostB:
return nrOfRunningJobsOnSourceHostA - nrOfRunningJobsOnSourceHostB
# equal number of jobs on source hosts, so sort on next sort criterion, the updated_at timestamp
# everything above equal? sort on next sort criterion, the group_id
if jad_a.get('job_group_id', 0) < jad_b.get('job_group_id', 0):
return -1
if jad_a.get('job_group_id', 0) > jad_b.get('job_group_id', 0):
return 1
# everything above equal? sort on next sort criterion, the updated_at timestamp
# least recent updated_at job goes first
# if no updated_at timestamp available, use 'now'
now = datetime.utcnow()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment