Commit ecdb5a38 authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Move magic symbol into a constant

parent ef5c42dd
......@@ -11,7 +11,8 @@ module EE
detail = super
if ::Gitlab::Database::LoadBalancing.enable?
role = ::Gitlab::Database::LoadBalancing.db_role_for_connection(data[:connection]) || :unknown
role = ::Gitlab::Database::LoadBalancing.db_role_for_connection(data[:connection]) ||
::Gitlab::Database::LoadBalancing::ROLE_UNKNOWN
detail[:db_role] = role.to_s.capitalize
end
......
......@@ -143,7 +143,8 @@ module Gitlab
DB_ROLES = [
ROLE_PRIMARY = :primary,
ROLE_REPLICA = :replica
ROLE_REPLICA = :replica,
ROLE_UNKNOWN = :unknown
].freeze
# Returns the role (primary/replica) of the database the connection is
......
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