changeset 8266:b2f7d1c4e001

celery: log an error for some deprecated config settings dburi was dropped from templates in d34a59bfcebb1 and is no longer supported in Celery 4. celery.send.task.error.emails will no longer be supported in Celery 4 and was just removed from the .ini template . The "serialier" typo was fixed in 8169770a4f2c. It might bite people if they keep using the wrong spelling.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 24 Feb 2020 17:51:17 +0100
parents ecd3cf91b293
children e432a6a7dd7c
files kallithea/lib/celerypylons/__init__.py
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/celerypylons/__init__.py	Thu Feb 20 01:35:22 2020 +0100
+++ b/kallithea/lib/celerypylons/__init__.py	Mon Feb 24 17:51:17 2020 +0100
@@ -14,6 +14,8 @@
 mandatory settings.
 """
 
+import logging
+
 import celery
 import tg
 
@@ -25,6 +27,16 @@
     CELERY_TASK_SERIALIZER = 'json'
 
 
+desupported = set([
+    'celery.result.dburi',
+    'celery.result.serialier',
+    'celery.send.task.error.emails',
+])
+
+
+log = logging.getLogger(__name__)
+
+
 def celery_config(config):
     """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
 
@@ -34,6 +46,8 @@
     LIST_PARAMS = """CELERY_IMPORTS CELERY_ACCEPT_CONTENT""".split()
 
     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 = config_key.replace('.', '_').upper()
         if celery_key.split('_', 1)[0] not in PREFIXES:
             continue