Use different cache namespaces for different tenants
Since records in different tenants can have the same ID, they can share the same `cache_key`, and so we need a namespace to differentiate them. Without them, records from one tenant could expire the cache of a record from another tenant.
This commit is contained in:
@@ -58,7 +58,7 @@ Rails.application.configure do
|
||||
config.log_tags = [:request_id]
|
||||
|
||||
# Use a different cache store in production.
|
||||
config.cache_store = :mem_cache_store
|
||||
config.cache_store = :mem_cache_store, { namespace: proc { Tenant.current_schema }}
|
||||
|
||||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
||||
# config.active_job.queue_adapter = :resque
|
||||
|
||||
Reference in New Issue
Block a user