Skip to content

Commit

Permalink
Add redis memcache to production (#579)
Browse files Browse the repository at this point in the history
Co-authored-by: beets <beets@users.noreply.github.com>
  • Loading branch information
shifucun and beets authored Oct 14, 2020
1 parent d1d216b commit 5bbf42d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})

0 comments on commit 5bbf42d

Please sign in to comment.