Commit a3542f83 authored by Sean McGivern's avatar Sean McGivern

Merge branch '341681-feature-flag-check-gap-fix' into 'master'

Memoize feature flag call in MergeRequests::AfterCreateService

See merge request gitlab-org/gitlab!75717
parents cba3a15c 57cd09b3
......@@ -2,6 +2,8 @@
module MergeRequests
class AfterCreateService < MergeRequests::BaseService
include Gitlab::Utils::StrongMemoize
def execute(merge_request)
prepare_for_mergeability(merge_request) if early_prepare_for_mergeability?(merge_request)
prepare_merge_request(merge_request)
......@@ -48,7 +50,9 @@ module MergeRequests
end
def early_prepare_for_mergeability?(merge_request)
Feature.enabled?(:early_prepare_for_mergeability, merge_request.target_project)
strong_memoize("early_prepare_for_mergeability_#{merge_request.target_project_id}".to_sym) do
Feature.enabled?(:early_prepare_for_mergeability, merge_request.target_project)
end
end
def mark_as_unchecked(merge_request)
......
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