Merge pull request #4356 from kristinalim/fix/4256-set_dalli_value_max_size

4256 Configure dalli store value max bytes from env variable
This commit is contained in:
Luis Ramos
2019-10-14 18:41:00 +01:00
committed by GitHub
3 changed files with 8 additions and 2 deletions

View File

@@ -56,3 +56,5 @@ SMTP_PASSWORD: 'f00d'
# STRIPE_INSTANCE_PUBLISHABLE_KEY: "pk_test_xxxx" # This can be a test key or a live key
# STRIPE_CLIENT_ID: "ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET: "whsec_xxxx"
MEMCACHED_VALUE_MAX_MEGABYTES: 4

View File

@@ -40,7 +40,9 @@ Openfoodnetwork::Application.configure do
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :dalli_store
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024
config.cache_store = :dalli_store, { value_max_bytes: memcached_value_max_bytes }
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View File

@@ -40,7 +40,9 @@ Openfoodnetwork::Application.configure do
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :dalli_store
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024
config.cache_store = :dalli_store, { value_max_bytes: memcached_value_max_bytes }
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"