Celery apply_async is very useful feature from celery to execute some task asynchronously / non blocking.
There are 2 options to delay your task execution:
- ETA (estimated time of arrival), which is you have to pass python datetime object to the argument.
next_month = timezone.now() + timezone.timedelta(days=30) my_task_function.apply_async(args=*args, eta=next_month)
Your celery task above will executed 1 month later.
- Countdown, which is you have to pass integer (in seconds) to the argument.
Your celery task above will executed after 10 seconds from now.