Skip to content

Commit

Permalink
Merge pull request ManageIQ#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?
  • Loading branch information
gtanzillo authored Jul 21, 2017
2 parents bc49aa0 + 8c3d35f commit 6e08686
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 6e08686

Please sign in to comment.