Unify celery config with gvaldap and gvaweb

This commit is contained in:
Jan Dittberner 2020-03-04 18:42:37 +01:00
parent aa2b87682f
commit c4e7e8c497
2 changed files with 4 additions and 4 deletions

View file

@ -11,5 +11,5 @@ from celery import Celery
#: The Celery application #: The Celery application
app = Celery('fileservertasks') app = Celery('fileservertasks')
app.config_from_object('fileservertasks.settings') app.config_from_object('fileservertasks.settings', namespace="CELERY")
app.autodiscover_tasks(['fileservertasks.tasks'], force=True) app.autodiscover_tasks(['fileservertasks.tasks'], force=True)

View file

@ -25,16 +25,16 @@ def get_env_variable(setting):
########## CELERY CONFIGURATION ########## CELERY CONFIGURATION
CELERY_TIMEZONE = "Europe/Berlin" CELERY_BROKER_URL = get_env_variable("GVAFILE_BROKER_URL")
CELERY_ENABLE_UTC = True
CELERY_RESULT_BACKEND = get_env_variable("GVAFILE_RESULTS_REDIS_URL") CELERY_RESULT_BACKEND = get_env_variable("GVAFILE_RESULTS_REDIS_URL")
CELERY_RESULT_PERSISTENT = True CELERY_RESULT_PERSISTENT = True
CELERY_TASK_RESULT_EXPIRES = None CELERY_TASK_RESULT_EXPIRES = None
CELERY_ROUTES = ("gvacommon.celeryrouters.GvaRouter",) CELERY_ROUTES = ("gvacommon.celeryrouters.GvaRouter",)
CELERY_TIMEZONE = "Europe/Berlin"
CELERY_ENABLE_UTC = True
CELERY_ACCEPT_CONTENT = ["json"] CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TASK_SERIALIZER = "json" CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json" CELERY_RESULT_SERIALIZER = "json"
BROKER_URL = get_env_variable("GVAFILE_BROKER_URL")
########## END CELERY CONFIGURATION ########## END CELERY CONFIGURATION
########## GVAFILE CONFIGURATION ########## GVAFILE CONFIGURATION