From d20081cd1cd829e03289734521bc37de6186b6a1 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Mon, 27 Nov 2017 12:03:04 -0500 Subject: [PATCH] Merge pull request #16432 from agrare/add_back_ems_refresh_unique_target Unique EmsRefresh.refresh targets if there are over 1,000 targets (cherry picked from commit fdb09c20fdb778fb3ef0238044b2ce907f43e1ff) https://bugzilla.redhat.com/show_bug.cgi?id=1517962 --- app/models/ems_refresh.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/ems_refresh.rb b/app/models/ems_refresh.rb index 1723eaa2663..f2658130c7c 100644 --- a/app/models/ems_refresh.rb +++ b/app/models/ems_refresh.rb @@ -172,6 +172,7 @@ def self.queue_merge(targets, ems, create_task = false) # Items will be naturally serialized since there is a dedicated worker. MiqQueue.put_or_update(queue_options) do |msg, item| targets = msg.nil? ? targets : msg.data.concat(targets) + targets.uniq! if targets.size > 1_000 # If we are merging with an existing queue item we don't need a new # task, just use the original one