From 3b76e753fe3a56ab89e57712c788cbcf0dfc5082 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Wed, 22 Nov 2023 13:15:01 +0100 Subject: [PATCH] Order both by priority and job_id, to ensure deterministic ordering When all priorities are the same. --- app/models/solid_queue/ready_execution.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/solid_queue/ready_execution.rb b/app/models/solid_queue/ready_execution.rb index 5375eaac..856aba6a 100644 --- a/app/models/solid_queue/ready_execution.rb +++ b/app/models/solid_queue/ready_execution.rb @@ -1,7 +1,7 @@ module SolidQueue class ReadyExecution < Execution scope :queued_as, ->(queue_name) { where(queue_name: queue_name) } - scope :ordered, -> { order(priority: :asc) } + scope :ordered, -> { order(priority: :asc, job_id: :asc) } assume_attributes_from_job