From cd68df49e0dcbd7cee356e991009e4138a447fbe Mon Sep 17 00:00:00 2001 From: Gregg Tanzillo Date: Thu, 20 Jul 2017 20:45:23 -0400 Subject: [PATCH] Merge pull request #15620 from djberg96/prefetch_below_threshold Check for messages key in prefetch_below_threshold? (cherry picked from commit 6e08686bb2b11bad81778eba9fd6baa9fe69b41c) https://bugzilla.redhat.com/show_bug.cgi?id=1480629 --- app/models/miq_server/worker_management/dequeue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/miq_server/worker_management/dequeue.rb b/app/models/miq_server/worker_management/dequeue.rb index b8f4abfeb39..13de06a89cc 100644 --- a/app/models/miq_server/worker_management/dequeue.rb +++ b/app/models/miq_server/worker_management/dequeue.rb @@ -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