We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe57349 commit 041b904Copy full SHA for 041b904
app/models/solid_queue/blocked_execution.rb
@@ -30,10 +30,10 @@ def release_one(concurrency_key)
30
31
private
32
def releasable(concurrency_keys)
33
- semaphores = Semaphore.where(key: concurrency_keys).select(:key, :value).index_by(&:key)
+ semaphores = Semaphore.where(key: concurrency_keys).pluck(:key, :value).to_h
34
35
# Concurrency keys without semaphore + concurrency keys with open semaphore
36
- (concurrency_keys - semaphores.keys) | semaphores.select { |key, semaphore| semaphore.value > 0 }.map(&:first)
+ (concurrency_keys - semaphores.keys) | semaphores.select { |_key, value| value > 0 }.keys
37
end
38
39
0 commit comments