我正在使用Django-Celery-Email。這個應用程序將發送一個任務發送電子郵件與常規「從django.core.mail導入send_mail」。Django-Celery - 如何知道子任務何時完成?
我已經寫了一個任務,將調用send_mail任務,但我需要什麼時候完成子任務在數據庫中執行更新。
這是我tasks.py
from celery import task
@task()
def send_ad_contact_email():
from django.core.mail import send_mail
# Send the e.mail
send_mail('test subject', 'Here is the message.', '[email protected]',
['[email protected]'], fail_silently=False)
# Update the email status on the model
# How can I know when send_mail(celery task) is done?
我怎麼能知道什麼時候send_mail(芹菜任務)完成?
最好的問候,