Skip to content

Commit

Permalink
Merge pull request #17402 from NickLaMuro/lighter_queries_in_miq_requ…
Browse files Browse the repository at this point in the history
…est_workflow

Avoid duplicate host load in allowed_hosts_obj
(cherry picked from commit d577df7)

https://bugzilla.redhat.com/show_bug.cgi?id=1593798
  • Loading branch information
gmcculloug authored and simaishi committed Jun 21, 2018
1 parent 831c643 commit 361707d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_request_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def allowed_hosts_obj(options = {})
return [] if hosts_ids.blank?

# Remove any hosts that are no longer in the list
all_hosts = load_ar_obj(src[:ems]).hosts.find_all { |h| hosts_ids.include?(h.id) }
all_hosts = load_ar_obj(src[:ems]).hosts.where(:id => hosts_ids)
allowed_hosts_obj_cache = process_filter(:host_filter, Host, all_hosts)
_log.info "allowed_hosts_obj returned [#{allowed_hosts_obj_cache.length}] objects in [#{Time.now - st}] seconds"
rails_logger('allowed_hosts_obj', 1)
Expand Down

0 comments on commit 361707d

Please sign in to comment.