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
  • Loading branch information
gmcculloug authored May 22, 2018
2 parents 35b479e + 809f655 commit d577df7
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 @@ -1046,7 +1046,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 d577df7

Please sign in to comment.