Welcome to mirror list, hosted at ThFree Co, Russian Federation.

request_store_callbacks.rb « action_cable « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f6dda18a4440728170d268ef830f1b429355529e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module ActionCable
    module RequestStoreCallbacks
      def self.install
        ::ActionCable::Server::Worker.set_callback :work, :around, &wrapper
      end

      def self.wrapper
        lambda do |_, inner|
          ::Gitlab::SafeRequestStore.ensure_request_store do
            inner.call
          end
        end
      end
    end
  end
end