Added a redis cache for the template usage stats.

Cache expires every 10 minutes, but will help with the every 2 second query, especially when a job is running.
There is some clean up and qa to do for this yet
This commit is contained in:
Rebecca Law
2017-02-13 18:47:29 +00:00
parent b2267ae5fc
commit 458adefcb8
9 changed files with 351 additions and 218 deletions

View File

@@ -49,6 +49,7 @@ class Config(object):
# URL of redis instance
REDIS_URL = os.getenv('REDIS_URL')
REDIS_ENABLED = os.getenv('REDIS_ENABLED') == '1'
EXPIRE_CACHE_IN_SECONDS = 600
# Performance platform
PERFORMANCE_PLATFORM_ENABLED = os.getenv('PERFORMANCE_PLATFORM_ENABLED') == '1'
@@ -185,6 +186,7 @@ class Development(Config):
Queue('research-mode', Exchange('default'), routing_key='research-mode')
]
API_HOST_NAME = "http://localhost:6011"
REDIS_ENABLED = True
class Test(Config):