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

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

module Gitlab
  module RackLoadBalancingHelpers
    def load_balancer_stick_request(model, namespace, id)
      request.env[::Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT] ||= Set.new
      request.env[::Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT] << [model.sticking, namespace, id]

      model
        .sticking
        .find_caught_up_replica(namespace, id)
    end
  end
end