Commit 6910064f authored by Stan Hu's avatar Stan Hu

Merge branch 'sh-geo-avoid-db-initializer' into 'master'

Avoid using the database in the Geo initializer

See merge request !2099
parents da35c469 2d6af8b9
...@@ -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