Skip to content

Commit

Permalink
Reinstate server addresses for cache_store
Browse files Browse the repository at this point in the history
This is necessary in Rails 6.0. We don't get the automatic fallback to ENV['MEMCACHED_SERVERS'] until Rails 6.1 (rails/rails#40420).
  • Loading branch information
jvendetti committed Mar 17, 2022
1 parent dfbfea8 commit d3210a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/environments/appliance.rb
Expand Up @@ -74,7 +74,7 @@
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 }
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { :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.
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Expand Up @@ -84,7 +84,7 @@
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 }
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { 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
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Expand Up @@ -74,7 +74,7 @@
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 }
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { 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.
Expand Down

0 comments on commit d3210a0

Please sign in to comment.