##// END OF EJS Templates
celery: register EE tasks if we have EE enabled
marcink -
r2465:0e246bbe default
parent child Browse files
Show More
@@ -28,6 +28,7 b' Celery loader, run with::'
28 """
28 """
29 import os
29 import os
30 import logging
30 import logging
31 import importlib
31
32
32 from celery import Celery
33 from celery import Celery
33 from celery import signals
34 from celery import signals
@@ -77,11 +78,21 b' def get_logger(obj):'
77 return custom_log
78 return custom_log
78
79
79
80
81 imports = ['rhodecode.lib.celerylib.tasks']
82
83 try:
84 # try if we have EE tasks available
85 importlib.import_module('rc_ee')
86 imports.append('rc_ee.lib.celerylib.tasks')
87 except ImportError:
88 pass
89
90
80 base_celery_config = {
91 base_celery_config = {
81 'result_backend': 'rpc://',
92 'result_backend': 'rpc://',
82 'result_expires': 60 * 60 * 24,
93 'result_expires': 60 * 60 * 24,
83 'result_persistent': True,
94 'result_persistent': True,
84 'imports': [],
95 'imports': imports,
85 'worker_max_tasks_per_child': 100,
96 'worker_max_tasks_per_child': 100,
86 'accept_content': ['json_ext'],
97 'accept_content': ['json_ext'],
87 'task_serializer': 'json_ext',
98 'task_serializer': 'json_ext',
General Comments 0
You need to be logged in to leave comments. Login now