Commit 8d7a968d authored by Yorick Peterse's avatar Yorick Peterse

Handle missing DBs in connect_to_db?

This ensures CurrentSettings#connect_to_db? returns "false" in the event
of a database not existing, instead of raising an error.
parent 61561a9e
......@@ -41,6 +41,9 @@ module Gitlab
use_db && ActiveRecord::Base.connection.active? &&
!ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings')
rescue ActiveRecord::NoDatabaseError
false
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