about summary refs log tree commit diff
diff options
context:
space:
mode:
authornightpool <nightpool@cybre.space>2019-06-15 10:47:09 -0400
committerchr <chr@cybre.space>2021-03-01 21:43:22 -0800
commit9e87a069bd58abf4493276a4a7a1fb7ceffbda76 (patch)
tree6e2e8405338b8709477d8443be2f3077782a394b
parent633d175146d6acaf2cc4bfbfcfdee4c85ef20ed1 (diff)
Use git commit hash as part of the cache key
avoids issues with model caching being incompatible across versions
-rw-r--r--lib/mastodon/redis_config.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mastodon/redis_config.rb b/lib/mastodon/redis_config.rb
index c3c8ff800..4f722a03d 100644
--- a/lib/mastodon/redis_config.rb
+++ b/lib/mastodon/redis_config.rb
@@ -24,7 +24,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,