Configure dalli store value max bytes from env variable

This commit is contained in:
Kristina Lim
2019-10-08 14:37:25 +08:00
parent c2f8803d72
commit cf05369ca9
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"