Commit 2d6af8b9 authored by Stan Hu's avatar Stan Hu

Avoid using the database in the Geo initializer

Running `bundle exec rake geo:db:migrate` would cause the warning to show
since ActiveRecord wasn't set up properly.
parent 26dfe71e
......@@ -6,9 +6,10 @@ if File.exist?(Rails.root.join('config/database_geo.yml')) &&
end
begin
if Gitlab::Geo.primary?
# Avoid using the database if this is run in a Rake task
if Gitlab::Geo.primary_role_enabled?
Gitlab::Geo.current_node.update_clone_url!
end
rescue
warn 'WARNING: Unable to check/update clone_url_prefix for Geo'
rescue => e
warn "WARNING: Unable to check/update clone_url_prefix for Geo: #{e}"
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