Skip to content

Commit

Permalink
Same
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Mar 11, 2024
1 parent 041b677 commit 6ea4707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/delayed/backend/modern_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def self.reserve(worker, max_run_time = Worker.max_run_time)

now = db_time_now.change(usec: 0)
count = ready_scope.limit(1).update_all(locked_at: now, locked_by: worker.name)
return nil if count == 0
return if count == 0

where(locked_at: now, locked_by: worker.name, failed_at: nil).first
end
Expand Down

0 comments on commit 6ea4707

Please sign in to comment.