##// END OF EJS Templates
celery: log an error for some deprecated config settings...
Mads Kiilerich -
r8135:b2f7d1c4 default
parent child Browse files
Show More
@@ -14,6 +14,8 To make sure that the config really has
14 14 mandatory settings.
15 15 """
16 16
17 import logging
18
17 19 import celery
18 20 import tg
19 21
@@ -25,6 +27,16 class CeleryConfig(object):
25 27 CELERY_TASK_SERIALIZER = 'json'
26 28
27 29
30 desupported = set([
31 'celery.result.dburi',
32 'celery.result.serialier',
33 'celery.send.task.error.emails',
34 ])
35
36
37 log = logging.getLogger(__name__)
38
39
28 40 def celery_config(config):
29 41 """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
30 42
@@ -34,6 +46,8 def celery_config(config):
34 46 LIST_PARAMS = """CELERY_IMPORTS CELERY_ACCEPT_CONTENT""".split()
35 47
36 48 for config_key, config_value in sorted(config.items()):
49 if config_key in desupported and config_value:
50 log.error('Celery configuration setting %r is no longer supported', config_key)
37 51 celery_key = config_key.replace('.', '_').upper()
38 52 if celery_key.split('_', 1)[0] not in PREFIXES:
39 53 continue
General Comments 0
You need to be logged in to leave comments. Login now