Retrieving GroupResult from taskset_id in Celery?

后端 未结 1 959
温柔的废话
温柔的废话 2020-12-31 10:03

I am starting a set of celery tasks by using celery group as described in the official documentation

I am also storing the group (taskset) id into a db, in order to

相关标签:
1条回答
  • 2020-12-31 10:44

    Yes you have to save the result and then restore it.

    job = group([
        single_test.s(1, 1),
        single_test.s(1, 2),
        single_test.s(1, 3),
    ])
    result = job.apply_async()
    result.save()
    
    from celery.result import GroupResult
    saved_result = GroupResult.restore(result.id)
    

    I had the same issue and after seeing your hint about save/restore eventually figured it out.

    0 讨论(0)
提交回复
热议问题