Module: Gitlab::WithRequestStore

Extended by:
WithRequestStore
Included in:
ImportExport::Project::BaseTask, Profiler, SidekiqMiddleware::RequestStoreMiddleware, WithRequestStore
Defined in:
lib/gitlab/with_request_store.rb

Instance Method Summary collapse

Instance Method Details

#with_request_store(&block) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/gitlab/with_request_store.rb', line 5

def with_request_store(&block)
  # Skip enabling the request store if it was already active. Whatever
  # instantiated the request store first is responsible for clearing it
  return yield if RequestStore.active?

  enabling_request_store(&block)
end