[英]Get task id of scheduled task in celery
我正在使用apply_async在django中安排一個芹菜任務。 我安排任務時需要獲取任務ID。
我需要獲取任務ID,以便在用戶選擇取消時可以撤消計划任務。
def some_function:
the_fn_to_be_called.apply_async(kwargs={my_arguments}, countdown=countdown_in_secs)
apply_async
返回一個具有id
屬性的AsyncResult 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.