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.
This commit is contained in:
parent
61561a9eeb
commit
8d7a968d6d
1 changed files with 3 additions and 0 deletions
|
@ -41,6 +41,9 @@ module Gitlab
|
||||||
use_db && ActiveRecord::Base.connection.active? &&
|
use_db && ActiveRecord::Base.connection.active? &&
|
||||||
!ActiveRecord::Migrator.needs_migration? &&
|
!ActiveRecord::Migrator.needs_migration? &&
|
||||||
ActiveRecord::Base.connection.table_exists?('application_settings')
|
ActiveRecord::Base.connection.table_exists?('application_settings')
|
||||||
|
|
||||||
|
rescue ActiveRecord::NoDatabaseError
|
||||||
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue