From 6ba5be12e4606dda1db13c3c5e7830250f1894bb Mon Sep 17 00:00:00 2001 From: Ankitha Damodara Date: Fri, 14 Jun 2024 13:57:02 +0100 Subject: [PATCH] fix spacing --- lib/que/locker.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/que/locker.rb b/lib/que/locker.rb index c3b23b9..d93815b 100644 --- a/lib/que/locker.rb +++ b/lib/que/locker.rb @@ -167,11 +167,12 @@ def lock_job_query(queue, cursor) def lock_job_with_lock_database(queue, cursor) query = QueJob.select(:job_id, :queue, :priority, :run_at, :job_class, :retryable, :args, :error_count) - .select("extract(epoch from (now() - run_at)) as latency") - .where("queue = ? AND job_id >= ? AND run_at <= ?", queue, cursor, Time.now) - .where(retryable: true) - .order(:priority, :run_at, :job_id) - .limit(1).to_sql + .select("extract(epoch from (now() - run_at)) as latency") + .where("queue = ? AND job_id >= ? AND run_at <= ?", queue, cursor, Time.now) + .where(retryable: true) + .order(:priority, :run_at, :job_id) + .limit(1).to_sql + result = Que.execute(query).first return result if result.nil?