我正在使用 Django-Celery-Email。这个应用程序将发送一个任务来发送一封带有常规“from django.core.mail import send_mail”的电子邮件。
我写了一个任务来调用 send_mail 任务,但是当子任务完成时我需要在数据库中进行更新。
这是我的任务.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.', 'somemail@gmail.com',
['tosomemail@gmail.com'], fail_silently=False)
# Update the email status on the model
# How can I know when send_mail(celery task) is done?
我怎么知道 send_mail(celery task) 什么时候完成?
此致,