Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 18:30:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 18:30:35 +0300
commit1a5cc87d341dbd1bf7740f48cdb458de1f8d1fc6 (patch)
treea11f3682b329c2c1f5c37fb201134ba2c254e65f /lib
parenta0a166e723005aea66e278c653542eb4e5cca11f (diff)
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index f943b532454..ebf2cdd875a 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -123,6 +123,16 @@ module Gitlab
def self.maintenance_mode?
return false unless ::Gitlab::CurrentSettings.current_application_settings?
+ # `maintenance_mode` column was added to the `current_settings` table in 13.2
+ # When upgrading from < 13.2 to >=13.8 `maintenance_mode` will not be
+ # found in settings.
+ # `Gitlab::CurrentSettings#uncached_application_settings` in
+ # lib/gitlab/current_settings.rb is expected to handle such cases, and use
+ # the default value for the setting instead, but in this case, it doesn't,
+ # see https://gitlab.com/gitlab-org/gitlab/-/issues/321836
+ # As a work around, we check if the setting method is available
+ return false unless ::Gitlab::CurrentSettings.respond_to?(:maintenance_mode)
+
::Gitlab::CurrentSettings.maintenance_mode
end
end