diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-02 19:59:54 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-02 19:59:54 +0300 |
commit | 1e8dbd46758d5c9772baf233ebcff889dc742d3d (patch) | |
tree | b5d61cdffae882d10625ce92fda445397adca1ed /lib | |
parent | 51c196160adfbdb723fa6295cddf74a5ce033d6b (diff) | |
parent | 23db8409aafc6cdbae165056ec037e31096a8a66 (diff) |
Merge branch '2361-pending-migrations-break-current-settings' into 'master'
Skip loading application settings from the database when migrations are pending
Closes gitlab-ee#2361
See merge request !11842
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/current_settings.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb index 82576d197fe..9e14b35b0f8 100644 --- a/lib/gitlab/current_settings.rb +++ b/lib/gitlab/current_settings.rb @@ -19,7 +19,7 @@ module Gitlab settings = ::ApplicationSetting.last end - settings ||= ::ApplicationSetting.create_from_defaults unless ActiveRecord::Migrator.needs_migration? + settings ||= ::ApplicationSetting.create_from_defaults end settings || in_memory_application_settings @@ -46,7 +46,8 @@ module Gitlab active_db_connection = ActiveRecord::Base.connection.active? rescue false active_db_connection && - ActiveRecord::Base.connection.table_exists?('application_settings') + ActiveRecord::Base.connection.table_exists?('application_settings') && + !ActiveRecord::Migrator.needs_migration? rescue ActiveRecord::NoDatabaseError false end |