Commit 616663f4 authored by Tom Powell's avatar Tom Powell

Enable caching

parent 4e2ea005
Pipeline #35346830 failed
......@@ -7,6 +7,8 @@ test:
image: python:3.6
tags:
- docker
variables:
FLASK_TESTING: True
script:
- pip install -e .
- python test.py
......
......@@ -47,6 +47,7 @@ def parse_args():
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(
......
......@@ -3,7 +3,11 @@ import os
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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment