Commit 43cfc786 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'refactor-vulnerability-feedback' into 'master'

Refactor loading of vulnerability feedback

See merge request gitlab-org/gitlab-ee!14580
parents 61ace015 f09b53ee
......@@ -119,14 +119,15 @@ module Vulnerabilities
}
BatchLoader.for(params).batch do |items, loader|
project_ids = items.group_by { |i| i[:project_id] }
categories = items.group_by { |i| i[:category] }
fingerprints = items.group_by { |i| i[:project_fingerprint] }
project_ids = items.map { |i| i[:project_id] }
categories = items.map { |i| i[:category] }
fingerprints = items.map { |i| i[:project_fingerprint] }
Vulnerabilities::Feedback.all_preloaded.where(
project_id: project_ids.keys,
category: categories.keys,
project_fingerprint: fingerprints.keys).find_each do |feedback|
project_id: project_ids.uniq,
category: categories.uniq,
project_fingerprint: fingerprints.uniq
).each do |feedback|
loaded_params = {
project_id: feedback.project_id,
category: feedback.category,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment