Commit 91e92d75 authored by Stan Hu's avatar Stan Hu

Merge branch 'db-load-balancer-code-reloading' into 'master'

Use fully qualified modules in connection proxy

See merge request gitlab-org/gitlab!31577
parents 37a1ca97 808e70e9
...@@ -64,7 +64,7 @@ module Gitlab ...@@ -64,7 +64,7 @@ module Gitlab
# #
# name - The name of the method to call on a connection object. # name - The name of the method to call on a connection object.
def read_using_load_balancer(name, args, &block) def read_using_load_balancer(name, args, &block)
method = Session.current.use_primary? ? :read_write : :read method = ::Gitlab::Database::LoadBalancing::Session.current.use_primary? ? :read_write : :read
@load_balancer.send(method) do |connection| @load_balancer.send(method) do |connection|
connection.send(name, *args, &block) connection.send(name, *args, &block)
...@@ -81,7 +81,7 @@ module Gitlab ...@@ -81,7 +81,7 @@ module Gitlab
# Sticking has to be enabled before calling the method. Not doing so # Sticking has to be enabled before calling the method. Not doing so
# could lead to methods called in a block still being performed on a # could lead to methods called in a block still being performed on a
# secondary instead of on a primary (when necessary). # secondary instead of on a primary (when necessary).
Session.current.write! if sticky ::Gitlab::Database::LoadBalancing::Session.current.write! if sticky
connection.send(name, *args, &block) connection.send(name, *args, &block)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment