Add redis result backend support

This commit changes the Celery result backend to redis as it has already
been done for the webinterface and gvaldap parts of gnuviechadmin.
This commit is contained in:
Jan Dittberner 2016-02-07 22:43:42 +01:00
parent f64a87714d
commit cbb695137c
2 changed files with 7 additions and 6 deletions

View file

@ -8,7 +8,7 @@ Common settings and globals.
from os import environ
def get_env_setting(setting):
def get_env_variable(setting):
"""
Get the environment setting or return exception.
@ -27,7 +27,7 @@ def get_env_setting(setting):
########## CELERY CONFIGURATION
CELERY_TIMEZONE = 'Europe/Berlin'
CELERY_ENABLE_UTC = True
CELERY_RESULT_BACKEND = 'amqp'
CELERY_RESULT_BACKEND = get_env_variable('GVAFILE_RESULTS_REDIS_URL')
CELERY_RESULT_PERSISTENT = True
CELERY_TASK_RESULT_EXPIRES = None
CELERY_ROUTES = (
@ -36,12 +36,12 @@ CELERY_ROUTES = (
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
BROKER_URL = get_env_setting('GVAFILE_BROKER_URL')
BROKER_URL = get_env_variable('GVAFILE_BROKER_URL')
########## END CELERY CONFIGURATION
########## GVAFILE CONFIGURATION
GVAFILE_SFTP_DIRECTORY = get_env_setting('GVAFILE_SFTP_DIRECTORY')
GVAFILE_MAIL_DIRECTORY = get_env_setting('GVAFILE_MAIL_DIRECTORY')
GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_setting(
GVAFILE_SFTP_DIRECTORY = get_env_variable('GVAFILE_SFTP_DIRECTORY')
GVAFILE_MAIL_DIRECTORY = get_env_variable('GVAFILE_MAIL_DIRECTORY')
GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_variable(
'GVAFILE_SFTP_AUTHKEYS_DIRECTORY')
########## END GVAFILE CONFIGURATION

View file

@ -6,3 +6,4 @@ kombu==3.0.33
pytz==2015.7
PyYAML==3.11
-e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon
redis==2.10.5