Commit 8495e855 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '39110-cache-licence-during-import' into 'master'

Cache license/feature-flag queries during import

Closes #39110

See merge request gitlab-org/gitlab!21751
parents 6e470884 a294a60a
...@@ -64,16 +64,25 @@ class GitlabProjectImport ...@@ -64,16 +64,25 @@ class GitlabProjectImport
private private
def with_request_store
RequestStore.begin!
yield
ensure
RequestStore.end!
RequestStore.clear!
end
# We want to ensure that all Sidekiq jobs are executed # We want to ensure that all Sidekiq jobs are executed
# synchronously as part of that process. # synchronously as part of that process.
# This ensures that all expensive operations do not escape # This ensures that all expensive operations do not escape
# to general Sidekiq clusters/nodes. # to general Sidekiq clusters/nodes.
def run_isolated_sidekiq_job def run_isolated_sidekiq_job
Sidekiq::Testing.fake! do Sidekiq::Testing.fake! do
with_request_store do
@project = create_project @project = create_project
execute_sidekiq_job execute_sidekiq_job
end
true true
end 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