Skip to content

Commit

Permalink
Merge pull request #646 from opensafely-core/db-sorting
Browse files Browse the repository at this point in the history
Sort jobs by if they need db or not
  • Loading branch information
bloodearnest authored Aug 31, 2023
2 parents 68db9b0 + d538405 commit 7c29953
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jobrunner/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def handle_jobs(api: Optional[ExecutorAPI]):
# workspace. This gives a fairer allocation of capacity among
# workspaces.
running_for_workspace[job.workspace],
# DB jobs are more important than cpu jobs
0 if job.requires_db else 1,
# Finally use job age as a tie-breaker
job.created_at,
)
Expand Down

0 comments on commit 7c29953

Please sign in to comment.