From 1a6bdd61e9f16796b7abcf04ca77554c5d79c1e6 Mon Sep 17 00:00:00 2001 From: nightpool Date: Sat, 15 Jun 2019 10:47:09 -0400 Subject: [PATCH] Use git commit hash as part of the cache key avoids issues with model caching being incompatible across versions --- lib/mastodon/redis_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/redis_config.rb b/lib/mastodon/redis_config.rb index f11d94a45..088f2271b 100644 --- a/lib/mastodon/redis_config.rb +++ b/lib/mastodon/redis_config.rb @@ -22,7 +22,7 @@ setup_redis_env_url setup_redis_env_url(:cache, false) namespace = ENV.fetch('REDIS_NAMESPACE') { nil } -cache_namespace = namespace ? namespace + '_cache' : 'cache' +cache_namespace = [namespace, 'cache', `git rev-parse --short HEAD`.strip].compact.join('_') REDIS_CACHE_PARAMS = { expires_in: 10.minutes,