##// END OF EJS Templates
celery: set default config values in code and remove them from the generated .ini...
Mads Kiilerich -
r8131:66670aff default
parent child Browse files
Show More
@@ -255,11 +255,7 b' use_celery = false'
255 ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:
255 ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:
256 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
256 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
257
257
258 celery.imports = kallithea.lib.celerylib.tasks
259 celery.accept.content = json
260 celery.result.backend = amqp://
258 celery.result.backend = amqp://
261 celery.result.serializer = json
262 celery.task.serializer = json
263
259
264 #celery.send.task.error.emails = true
260 #celery.send.task.error.emails = true
265 #celery.amqp.task.result.expires = 18000
261 #celery.amqp.task.result.expires = 18000
@@ -18,15 +18,16 b' import celery'
18 import tg
18 import tg
19
19
20
20
21 class CeleryConfig(object):
22 CELERY_IMPORTS = ['kallithea.lib.celerylib.tasks']
23 CELERY_ACCEPT_CONTENT = ['json']
24 CELERY_RESULT_SERIALIZER = 'json'
25 CELERY_TASK_SERIALIZER = 'json'
26
27
21 def celery_config(config):
28 def celery_config(config):
22 """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
29 """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
23
30
24 # Verify .ini file configuration has been loaded
25 assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded'
26
27 class CeleryConfig(object):
28 pass
29
30 celery_config = CeleryConfig()
31 celery_config = CeleryConfig()
31
32
32 PREFIXES = """ADMINS BROKER CASSANDRA CELERYBEAT CELERYD CELERYMON CELERY EMAIL SERVER""".split()
33 PREFIXES = """ADMINS BROKER CASSANDRA CELERYBEAT CELERYD CELERYMON CELERY EMAIL SERVER""".split()
@@ -361,11 +361,7 b' use_celery = false'
361 <%text>## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:</%text>
361 <%text>## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:</%text>
362 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
362 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
363
363
364 celery.imports = kallithea.lib.celerylib.tasks
365 celery.accept.content = json
366 celery.result.backend = amqp://
364 celery.result.backend = amqp://
367 celery.result.serializer = json
368 celery.task.serializer = json
369
365
370 #celery.send.task.error.emails = true
366 #celery.send.task.error.emails = true
371 #celery.amqp.task.result.expires = 18000
367 #celery.amqp.task.result.expires = 18000
General Comments 0
You need to be logged in to leave comments. Login now