From 66eb4d851e63d20031502ec0c96aaabe34c6fd32 Mon Sep 17 00:00:00 2001 From: maxbr Date: Fri, 19 Aug 2016 17:11:58 +0200 Subject: Implement periodic tasks JIRA: RELENG-12 The dashboard is now querying jenkins periodically and saving the results in the database. This fixes delays that were caused by calling the jenkins API. Signed-off-by: maxbr --- tools/pharos-dashboard/pharos_dashboard/settings.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tools/pharos-dashboard/pharos_dashboard/settings.py') diff --git a/tools/pharos-dashboard/pharos_dashboard/settings.py b/tools/pharos-dashboard/pharos_dashboard/settings.py index b6e98991..77175016 100644 --- a/tools/pharos-dashboard/pharos_dashboard/settings.py +++ b/tools/pharos-dashboard/pharos_dashboard/settings.py @@ -15,7 +15,6 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ @@ -27,7 +26,6 @@ DEBUG = True ALLOWED_HOSTS = [] - # Application definition INSTALLED_APPS = [ @@ -43,6 +41,8 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.humanize', 'bootstrap3', + 'djcelery', + 'kombu.transport.django', ] MIDDLEWARE = [ @@ -77,7 +77,6 @@ TEMPLATES = [ WSGI_APPLICATION = 'pharos_dashboard.wsgi.application' - # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases @@ -92,7 +91,6 @@ DATABASES = { } } - # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators @@ -124,7 +122,6 @@ USE_L10N = True USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ @@ -139,3 +136,11 @@ BOOTSTRAP3 = { } LOGIN_REDIRECT_URL = '/' + +import djcelery + +djcelery.setup_loader() +# django broker, NOT SAFE FOR PRODUCTION +BROKER_URL = 'django://' +CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' + -- cgit 1.2.3-korg