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