args['build_date'] = datetime.datetime.strptime(request.args.get('date'), '%Y-%m-%d').date()
return args
+@cache.memoize()
def stats():
runner_build_times = models.Build.query.join(models.Build.build_runner).with_entities(
SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", 'sqlite:////tmp/ui.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = 'FLASK_DEBUG' in os.environ
-CACHE_TYPE = 'simple'
+
+TESTING = 'FLASK_TESTING' in os.environ
+
+CACHE_TYPE = os.environ.get('CACHE_TYPE', 'simple')
+CACHE_DEFAULT_TIMEOUT = int(os.environ.get('CACHE_DEFAULT_TIMEOUT', 60))
GITLAB_WEBHOOK_TOKEN = os.environ.get("GITLAB_WEBHOOK_TOKEN", "secret")