# HG changeset patch # User Mads Kiilerich # Date 1604693720 -3600 # Node ID eed44652346d67ae6ba5c1ccc6b56bf865250758 # Parent ea1c608efa3ab687c8971867a94256358dc3f203 celery: drop pre-celery-4 compatibility diff -r ea1c608efa3a -r eed44652346d kallithea/lib/celery_app.py --- a/kallithea/lib/celery_app.py Sat Nov 07 18:49:57 2020 +0100 +++ b/kallithea/lib/celery_app.py Fri Nov 06 21:15:20 2020 +0100 @@ -26,27 +26,22 @@ imports = ['kallithea.model.async_tasks'] task_always_eager = False -# map from Kallithea .ini Celery 3 config names to Celery 4 config names -celery3_compat = { - 'broker.url': 'broker_url', - 'celery.accept.content': 'accept_content', - 'celery.always.eager': 'task_always_eager', - 'celery.amqp.task.result.expires': 'result_expires', - 'celeryd.concurrency': 'worker_concurrency', - 'celeryd.max.tasks.per.child': 'worker_max_tasks_per_child', - #'celery.imports' ends up unchanged - 'celery.result.backend': 'result_backend', - 'celery.result.serializer': 'result_serializer', - 'celery.task.serializer': 'task_serializer', -} - -list_config_names = """imports accept_content""".split() +list_config_names = {'imports', 'accept_content'} desupported = set([ + 'broker.url', + 'celery.accept.content', + 'celery.always.eager', + 'celery.amqp.task.result.expires', + 'celeryd.concurrency', + 'celeryd.max.tasks.per.child', + 'celery.result.backend', # Note: the .ini template used this instead of 'celery.result_backend' in 0.6 'celery.result.dburi', 'celery.result.serialier', + 'celery.result.serializer', 'celery.send.task.error.emails', + 'celery.task.serializer', ]) @@ -61,11 +56,8 @@ for config_key, config_value in sorted(config.items()): if config_key in desupported and config_value: log.error('Celery configuration setting %r is no longer supported', config_key) - celery_key = celery3_compat.get(config_key) parts = config_key.split('.', 1) - if celery_key: # explicit Celery 3 backwards compatibility - pass - elif parts[0] == 'celery' and len(parts) == 2: # Celery 4 config key + if parts[0] == 'celery' and len(parts) == 2: # Celery 4 config key celery_key = parts[1] else: continue