Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
revoke celery chain eager mode

I am using celery chain in Django project.

For chained tasks, I am using task_postrun signal to revoke all subsequent tasks similar to this.

@task_postrun.connect
def task_postrun_handler(
    signal, sender, task_id, task, retval, state, args, kwargs, **kwds
):
    # do other things first
    if retval != 1:
        task.request.chain[:] = []

So if the task's return value is not 1, then revoke all the subsequent tasks. It works fine.

However, in my test, I run the tasks in eager mode. It does enter the task_postrun_handler, but doesn't have array of chain ( the callbacks is None as well).

In this way, I am not able to terminate the task chains in my test. I tried both in celery 3.1.23 and celery 4.0.2

Thanks for any help.

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda