mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-07-25 17:08:32 +00:00
15 lines
446 B
Ruby
15 lines
446 B
Ruby
# 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
|