From 3565c8701f2853f891c1be4ef8b7477faaec2f2c Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Fri, 28 Jul 2017 17:34:00 +0200 Subject: [PATCH] Raise creation event batched job Raise creation event batched job, sparing queries and trying not to bloat MiqQueue. --- app/models/container_image.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/container_image.rb b/app/models/container_image.rb index 322e1d5ff85..facd9337b4a 100644 --- a/app/models/container_image.rb +++ b/app/models/container_image.rb @@ -75,6 +75,12 @@ def perform_metadata_scan(ost) scan_via_miq_vm(miq_cnt_group, ost) end + def self.raise_creation_events(container_image_ids) + where(:id => container_image_ids).find_each do |record| + MiqEvent.raise_evm_event(record, 'containerimage_created', {}) + end + end + def raise_creation_event MiqEvent.raise_evm_event(self, 'containerimage_created', {}) end