From dfb3ba732b201c992e5b188be78a526b2b21d4c7 Mon Sep 17 00:00:00 2001 From: Ankitha Damodara Date: Tue, 3 Sep 2024 13:22:05 +0100 Subject: [PATCH] remove not reachable code --- lib/que/adapters/active_record_with_lock.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/que/adapters/active_record_with_lock.rb b/lib/que/adapters/active_record_with_lock.rb index 7dbd41b..4f76532 100644 --- a/lib/que/adapters/active_record_with_lock.rb +++ b/lib/que/adapters/active_record_with_lock.rb @@ -50,7 +50,7 @@ def execute(command, params = []) def lock_job_with_lock_database(queue, cursor) loop do observe(duration_metric: FindJobSecondsTotal, labels: { queue: queue }) do - locked_job = Que.transaction do + Que.transaction do job_to_lock = Que.execute(:find_job_to_lock, [queue, cursor]) return job_to_lock if job_to_lock.empty? @@ -61,7 +61,6 @@ def lock_job_with_lock_database(queue, cursor) observe(count_metric: FindJobHitTotal, labels: { queue: queue, job_hit: job_locked }) return job_to_lock if job_locked end - return locked_job if locked_job end end end