From bef53fe2d74a353289bcc0c7c73176ec0a27d1ac Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Fri, 24 Feb 2017 16:29:50 +0100 Subject: [PATCH] Load created Vms in batches so they don't load all in memory Load created Vms in batches so they don't load all in memory --- app/models/vm_or_template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/vm_or_template.rb b/app/models/vm_or_template.rb index ae390fe1969..54d461d456c 100644 --- a/app/models/vm_or_template.rb +++ b/app/models/vm_or_template.rb @@ -1137,7 +1137,7 @@ def self.post_refresh_ems(ems_id, update_start_time) # Create queue items to do additional process like apply tags and link events unless added_vms.empty? added_vm_ids = [] - added_vms.each do |v| + added_vms.find_each do |v| v.post_create_actions_queue added_vm_ids << v.id end