Skip to content

Commit

Permalink
Configure cache_store after loading environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jvendetti committed Mar 16, 2022
1 parent 218b927 commit dfbfea8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config/environments/appliance.rb
Expand Up @@ -50,9 +50,6 @@
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production.
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { :namespace => 'bioportal_web_ui', :expires_in => 1.day }

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'

Expand All @@ -76,6 +73,9 @@
# Include the BioPortal-specific configuration options
require Rails.root.join('config', "bioportal_config_#{Rails.env}.rb")

# Use a different cache store in the appliance.
config.cache_store = :mem_cache_store, { :namespace => 'bioportal_web_ui', :expires_in => 1.day }

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
Expand Down
6 changes: 3 additions & 3 deletions config/environments/production.rb
Expand Up @@ -56,9 +56,6 @@
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]

# Use a different cache store in production.
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { namespace: 'bioportal_web_ui', expires_in: 1.day }

# Use a real queuing backend for Active Job (and separate queues per environment).
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "bioportal_web_ui_production"
Expand Down Expand Up @@ -86,6 +83,9 @@
# Include the BioPortal-specific configuration options
require Rails.root.join('config', "bioportal_config_#{Rails.env}.rb")

# Use a different cache store in production.
config.cache_store = :mem_cache_store, { namespace: 'bioportal_web_ui', expires_in: 1.day }

# Add custom data attributes to sanitize allowed list
config.action_view.sanitized_allowed_attributes = ['id', 'class', 'style', 'data-cls', 'data-ont']

Expand Down
6 changes: 3 additions & 3 deletions config/environments/staging.rb
Expand Up @@ -50,9 +50,6 @@
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production.
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { namespace: 'bioportal_web_ui', expires_in: 1.day }

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'

Expand All @@ -76,6 +73,9 @@
# Include the BioPortal-specific configuration options
require Rails.root.join('config', "bioportal_config_#{Rails.env}.rb")

# Use a different cache store in staging.
config.cache_store = :mem_cache_store, { namespace: 'bioportal_web_ui', expires_in: 1.day }

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
Expand Down

0 comments on commit dfbfea8

Please sign in to comment.