From 5bbf42ddaf6a24e774187a927ec0350812dd0e02 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Wed, 14 Oct 2020 13:08:03 -0700 Subject: [PATCH] Add redis memcache to production (#579) Co-authored-by: beets --- server/cache.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/cache.py b/server/cache.py index 0f3130a389..1cd9f2dd91 100644 --- a/server/cache.py +++ b/server/cache.py @@ -24,5 +24,13 @@ 'CACHE_REDIS_PORT': '6379', 'CACHE_REDIS_URL': 'redis://10.67.227.235:6379' }) +elif os.environ.get('FLASK_ENV') == 'production': + cache = Cache( + config={ + 'CACHE_TYPE': 'redis', + 'CACHE_REDIS_HOST': '10.68.41.20', + 'CACHE_REDIS_PORT': '6379', + 'CACHE_REDIS_URL': 'redis://10.68.41.20:6379' + }) else: cache = Cache(config={'CACHE_TYPE': 'simple'})