You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! This is a great plugin and I have been using it in my dev environment and it has been pretty easy to use.
I'm trying to create scheduled tasks based on user request, Is it possible to create a scheduled task dynamically? Below is an example of what I would like to do.
@app.route("/setup-task", methods=["POST"]
defsetup_task():
req_json=request.get_json()
celery.schedule(
hour=req_json['hour'],
minute=req_json['minute'],
method_name='myTask',
name='scheduled-task-to-run-at-midnight'
)
return'A Task has been scheduled'
Please let me know if you need me to provide further information. Appreciate your work and time.
Thanks
The text was updated successfully, but these errors were encountered:
Thanks! I'm glad to hear the plugin has been helpful.
Unfortunately, dynamic scheduling with celery isn't currently available. In the meantime, a potential workaround could be:
Create "placeholder" tasks that run periodically at intervals useful to your application.
Whenever a new task needs to be scheduled, save it to a database table (assuming your application uses a database).
Whenever those "placeholder" tasks execute, they query your database for scheduled tasks to execute and run them via celery. If there aren't any scheduled tasks saved in the database, the "placeholder" task would just NOOP.
Either way, I think dynamic scheduling would be an awesome addition to the project. I'll add it to the queue of future work.
Thanks! I'm glad to hear the plugin has been helpful.
Unfortunately, dynamic scheduling with celery isn't currently available. In the meantime, a potential workaround could be:
Create "placeholder" tasks that run periodically at intervals useful to your application.
Whenever a new task needs to be scheduled, save it to a database table (assuming your application uses a database).
Whenever those "placeholder" tasks execute, they query your database for scheduled tasks to execute and run them via celery. If there aren't any scheduled tasks saved in the database, the "placeholder" task would just NOOP.
Either way, I think dynamic scheduling would be an awesome addition to the project. I'll add it to the queue of future work.
Thanks for getting back and also adding it as a feature. I also thought of the workaround and implemented it for now in my app!
Looking forward to it. Would love to help out in anyway I can 😄
Hi! This is a great plugin and I have been using it in my dev environment and it has been pretty easy to use.
I'm trying to create scheduled tasks based on user request, Is it possible to create a scheduled task dynamically? Below is an example of what I would like to do.
Please let me know if you need me to provide further information. Appreciate your work and time.
Thanks
The text was updated successfully, but these errors were encountered: