Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f9e7aa19
Commit
f9e7aa19
authored
Dec 22, 2020
by
Aakriti Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Database should be read-only in maintenance mode
parent
94076566
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
ee/lib/ee/gitlab/database.rb
ee/lib/ee/gitlab/database.rb
+1
-1
ee/spec/lib/ee/gitlab/database_spec.rb
ee/spec/lib/ee/gitlab/database_spec.rb
+10
-0
No files found.
ee/lib/ee/gitlab/database.rb
View file @
f9e7aa19
...
...
@@ -10,7 +10,7 @@ module EE
override
:read_only?
def
read_only?
::
Gitlab
::
Geo
.
secondary?
::
Gitlab
::
Geo
.
secondary?
||
::
Gitlab
.
maintenance_mode?
end
def
healthy?
...
...
ee/spec/lib/ee/gitlab/database_spec.rb
View file @
f9e7aa19
...
...
@@ -34,6 +34,16 @@ RSpec.describe Gitlab::Database do
expect
(
described_class
.
read_only?
).
to
be_falsey
end
end
context
'in maintenance mode'
do
before
do
stub_application_setting
(
maintenance_mode:
true
)
end
it
'returns true'
do
expect
(
described_class
.
read_only?
).
to
be_truthy
end
end
end
describe
'.healthy?'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment