Refactoring Gitlab::Geo::HealthCheck

parent 820742a6
......@@ -4,8 +4,8 @@ module Gitlab
def self.perform_checks
return '' unless Gitlab::Geo.secondary?
database_version = self.get_database_version
migration_version = self.get_migration_version
database_version = self.get_database_version.to_i
migration_version = self.get_migration_version.to_i
if database_version != migration_version
"Current Geo database version (#{database_version}) does not match latest migration (#{migration_version})."
......@@ -30,9 +30,6 @@ module Gitlab
connection.execute("SELECT MAX(version) AS version FROM #{schema_migrations_table_name}")
.first
.fetch('version')
.to_i
else
0
end
end
end
......@@ -48,7 +45,7 @@ module Gitlab
end
end
latest_migration.to_i
latest_migration
end
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