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')) && ...@@ -6,9 +6,10 @@ if File.exist?(Rails.root.join('config/database_geo.yml')) &&
end end
begin 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! Gitlab::Geo.current_node.update_clone_url!
end end
rescue rescue => e
warn 'WARNING: Unable to check/update clone_url_prefix for Geo' warn "WARNING: Unable to check/update clone_url_prefix for Geo: #{e}"
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