Commit 91b7cf3e authored by Jonathan Schafer's avatar Jonathan Schafer

Fix DB load balance autoloading/code-reloading

Changelog: changed
parent 5a53744e
...@@ -35,12 +35,12 @@ module Gitlab ...@@ -35,12 +35,12 @@ module Gitlab
# connection.load_balancer.primary_write_location # connection.load_balancer.primary_write_location
# end # end
# #
job['wal_locations'] = { Gitlab::Database::MAIN_DATABASE_NAME.to_sym => wal_location } if wal_location job['wal_locations'] = { ::Gitlab::Database::MAIN_DATABASE_NAME.to_sym => wal_location } if wal_location
end end
def wal_location def wal_location
strong_memoize(:wal_location) do strong_memoize(:wal_location) do
if Session.current.use_primary? if ::Gitlab::Database::LoadBalancing::Session.current.use_primary?
load_balancer.primary_write_location load_balancer.primary_write_location
else else
load_balancer.host.database_replica_location load_balancer.host.database_replica_location
...@@ -49,7 +49,7 @@ module Gitlab ...@@ -49,7 +49,7 @@ module Gitlab
end end
def load_balancer def load_balancer
LoadBalancing.proxy.load_balancer ::Gitlab::Database::LoadBalancing.proxy.load_balancer
end end
end end
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