Commit af0c054c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Resolve Gitaly N+1 for CI/CD environments statuses

parent 49f8697a
......@@ -1914,9 +1914,8 @@ class Project < ApplicationRecord
@route_maps_by_commit ||= Hash.new do |h, sha|
h[sha] = begin
data = repository.route_map_for(sha)
next unless data
Gitlab::RouteMap.new(data)
Gitlab::RouteMap.new(data) if data
rescue Gitlab::RouteMap::FormatError
nil
end
......
......@@ -922,7 +922,7 @@ describe Projects::MergeRequestsController do
expect(merge_request).to be_present
expect { get_ci_environments_status }
.not_to change { Gitlab::GitalyClient.get_request_count }
.to change { Gitlab::GitalyClient.get_request_count }.by_at_most(1)
end
end
......@@ -937,7 +937,7 @@ describe Projects::MergeRequestsController do
expect(merge_request.merge_request_diff.merge_request_diff_files).to be_many
expect { get_ci_environments_status }
.not_to change { Gitlab::GitalyClient.get_request_count }
.to change { Gitlab::GitalyClient.get_request_count }.by_at_most(1)
end
end
end
......
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