Commit 0636e317 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'ag-block-graphql-post-requests' into 'master'

Database should be read-only in maintenance mode

See merge request gitlab-org/gitlab!50425
parents 6bbe2127 f9e7aa19
...@@ -10,7 +10,7 @@ module EE ...@@ -10,7 +10,7 @@ module EE
override :read_only? override :read_only?
def read_only? def read_only?
::Gitlab::Geo.secondary? ::Gitlab::Geo.secondary? || ::Gitlab.maintenance_mode?
end end
def healthy? def healthy?
......
...@@ -34,6 +34,16 @@ RSpec.describe Gitlab::Database do ...@@ -34,6 +34,16 @@ RSpec.describe Gitlab::Database do
expect(described_class.read_only?).to be_falsey expect(described_class.read_only?).to be_falsey
end end
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 end
describe '.healthy?' do describe '.healthy?' do
......
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