Files
gitlab-foss/lib/gitlab/action_cable/ip_address_state_callback.rb
2025-04-09 15:18:25 +00:00

20 lines
472 B
Ruby

# frozen_string_literal: true
module Gitlab
module ActionCable
module IpAddressStateCallback
def self.install
::ActionCable::Server::Worker.set_callback :work, :around, &wrapper
end
def self.wrapper
->(_, inner) do
::Gitlab::IpAddressState.with(connection.request.ip) do # rubocop: disable CodeReuse/ActiveRecord -- not an ActiveRecord object
inner.call
end
end
end
end
end
end