Skip to content

Commit

Permalink
Merge pull request #15620 from djberg96/prefetch_below_threshold
Browse files Browse the repository at this point in the history
Check for messages key in prefetch_below_threshold?
(cherry picked from commit 6e08686)

https://bugzilla.redhat.com/show_bug.cgi?id=1480629
  • Loading branch information
gtanzillo authored and simaishi committed Aug 11, 2017
1 parent f9b9ad0 commit cd68df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_server/worker_management/dequeue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def prefetch_stale_threshold

def prefetch_below_threshold?(queue_name, wcount)
@queue_messages_lock.synchronize(:SH) do
return false if @queue_messages[queue_name].nil?
return false unless @queue_messages.key_path?(queue_name, :messages)
return (@queue_messages[queue_name][:messages].length <= (::Settings.server.prefetch_min_per_worker_dequeue * wcount))
end
end
Expand Down

0 comments on commit cd68df4

Please sign in to comment.