[Python] Chaining celery task results not working with signatures and kwargs

Discussão em 'Python' iniciado por Stack, Fevereiro 13, 2025.

  1. Stack

    Stack Membro Participativo

    This is what I was doing, and it was working up until today.

    workflow = chain(
    signature(
    "my.task",
    args=(1, 2, 3),
    options={"queue": "default"},
    ),
    signature(
    "my.other.task",
    kwargs={
    "explicity_param1": 10,
    "explicit_param2": 12,
    },
    options={"queue": "default"},
    ),
    )()

    @shared_task(bind=true, name="my.task")
    def my_task(self, a, b, c)
    return a + b + c

    @shared_task(bind=true, name="my.other.task")
    def my_other_task(self, from_task, explicity_param1, explicity_param2)
    return from_task + explicity_param1 + explicity_param2


    I could pass a result from the first task to the next while also setting explicit params. Now it doesnt seem to be passing the result at all, but I still get the kwargs. One day I moved things around and now the result of the first function in the second task comes up as None

    Continue reading...

Compartilhe esta Página