Skip to content
Snippets Groups Projects

Introduce :gitlab_geo schema for Geo tracking DB

Compare and Show latest version
4 files
+ 10
10
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -34,14 +34,8 @@ def perform
# If two DBs are configured (Main, CI): minute 1 -> Main, minute 2 -> CI
def current_connection_name_and_base_model
minutes_since_epoch = Time.current.to_i / 60
connections_with_name = shared_database_base_models.to_a # this will never be empty
connections_with_name = Gitlab::Database.shared_database_base_models.to_a # this will never be empty
connections_with_name[minutes_since_epoch % connections_with_name.count]
end
def shared_database_base_models
Gitlab::Database.schemas_to_base_models[:gitlab_shared].to_a.each_with_object({}) do |base_model, result|
result[Gitlab::Database.db_config_name(base_model.connection)] = base_model
end
end
end
end
Loading