diff options
Diffstat (limited to 'lib/gitlab/with_request_store.rb')
-rw-r--r-- | lib/gitlab/with_request_store.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/with_request_store.rb b/lib/gitlab/with_request_store.rb new file mode 100644 index 00000000000..d6c05e1e256 --- /dev/null +++ b/lib/gitlab/with_request_store.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Gitlab + module WithRequestStore + def with_request_store + RequestStore.begin! + yield + ensure + RequestStore.end! + RequestStore.clear! + end + end +end |