diff options
author | DJ Mountney <david@twkie.net> | 2016-05-29 12:53:30 -0700 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2016-05-29 12:53:30 -0700 |
commit | c8eb1dccabe5cd961895127dbbbf46d3eee4aebd (patch) | |
tree | ff0cbe5365a23825fb3851bf9b3ca528c534ed63 /app | |
parent | 7d57b110934f50225142789a93a0d4f54cf446f7 (diff) | |
download | gitlab-ce-c8eb1dccabe5cd961895127dbbbf46d3eee4aebd.tar.gz |
Try and use cache for application settings even when the db is not connectedcurrent-settings-use-request-store-during-request
Diffstat (limited to 'app')
-rw-r--r-- | app/models/application_setting.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 9a14954b4a7..33069d66d78 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -98,6 +98,10 @@ class ApplicationSetting < ActiveRecord::Base Rails.cache.delete(CACHE_KEY) end + def self.cached + Rails.cache.fetch(CACHE_KEY) + end + def self.create_from_defaults create( default_projects_limit: Settings.gitlab['default_projects_limit'], |