This is the use case I am looking for:
My application is written in Django.
When a user creates a new reminder just schedule a send email task in celery. Note that this is a simple solution but it will make it hard for the user to change notification time after creating it.
From this answer :
To execute a task at a specified date and time you can use eta attribute of apply_async while calling task as mentioned in docs
your_task.apply_async(kwargs={}, eta="your_send_time")
A different solution is to have a task running every 1 minute which will check in DB if there are any emails to be sent. You don't have to use Celery for that. Cron-like lib should do the trick. For example schedule lib or django-cron or Django Commands
Edit: this guy says you should not use dbader/schedule with Django.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.