Commit bbeeaad3 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Raise exception when Geo secondary database is not configured

This is used by ActiveRecord before establishing a connection.
Otherwise the user would receive a crypt `relation "xxx" does not exist"
exception.
parent 85608902
......@@ -4,4 +4,10 @@ class Geo::BaseRegistry < ActiveRecord::Base
if Gitlab::Geo.secondary_role_enabled? && Gitlab::Geo.geo_database_configured?
establish_connection Rails.configuration.geo_database
end
def self.connection
raise 'Geo secondary database is not configured' unless Gitlab::Geo.geo_database_configured?
super
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