2

I have to execute a task at a specific time, which is specified by the user. This will not be fix time... It will be according to user...

On that time I have to execute my task...

To achieve this I tried to use django-cron also tried to use django-crontab...

But in both case either we have to specify cron details in settings.py or we've to execute runcron commands.

I also checked django-celery (I don't have any idea about celery much. I may be wrong).

In celery we have to specify time while defining task...

Can any one help me how can I do this...

I am using django as a backend...

2

1 Answer 1

1

To execute a task at specified date and time you can use eta attribute of apply_async while calling task as mentioned in docs(http://docs.celeryproject.org/en/latest/userguide/calling.html#eta-and-countdown)

your_task.apply_async(kwargs={}, eta="your_send_time")

## Note: your_send_time should be of type `datetime`.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.