mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00
Create idea of read-only database
In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo secondary node). But in GitLab CE it also might be useful to have the "read-only" idea around. So port it back to GitLab CE. Also having the principle of read-only in GitLab CE would hopefully lead to less errors introduced, doing write operations when there aren't allowed for read-only calls. Closes gitlab-org/gitlab-ce#37534.
This commit is contained in:
@ -40,7 +40,7 @@ module Banzai
|
||||
return cacheless_render_field(object, field)
|
||||
end
|
||||
|
||||
object.refresh_markdown_cache!(do_update: update_object?(object)) unless object.cached_html_up_to_date?(field)
|
||||
object.refresh_markdown_cache! unless object.cached_html_up_to_date?(field)
|
||||
|
||||
object.cached_html_for(field)
|
||||
end
|
||||
@ -162,10 +162,5 @@ module Banzai
|
||||
return unless cache_key
|
||||
Rails.cache.__send__(:expanded_key, full_cache_key(cache_key, pipeline_name)) # rubocop:disable GitlabSecurity/PublicSend
|
||||
end
|
||||
|
||||
# GitLab EE needs to disable updates on GET requests in Geo
|
||||
def self.update_object?(object)
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user