Celery task error

I have a celery problem with my DJANGO app. When the task has an error, the tasks are looped and restarted, and do not complete the task. My task starts the stored procedure from the database. In the stored procedure, I have if any error sends an email and exits the stored procedure.

I have two employees with different concurrency

celery multi start carga_w conc_w -A provcon -Q:conc_w conc -Q:carga_w carga -l info -c:conc_w 1 -c:carga_w 3 -E

Task:

@task(queue='conc')
def conci(idprov,pfecha):
    conci = Buscar_Conci()
    spconc = conci.buscarcon(idprov,pfecha)
    return None

Try to clear the task, it will not work, and the task will save it in memory. To clear the task, I use the following command:

celery -A provcon purge -f

This is my first time using Celery with DJANGO, and I don't know if I missed something or I have the wrong settings:

BROKER_URL = 'redis://localhost:6379/0'
CELERY_IMPORTS = ("pc.tasks", )
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_RESULT_BACKEND='djcelery.backends.cache:CacheBackend'

To kill a task when entering this loop, I need to kill it from the database because I cannot stop from the django-admin site or using the celery cleanup command

, .

+4

All Articles