In our production environment, we have a Celery beat configured to perform periodic tasks according to the frequency.
My question is, is there a way for me to start the task that was meant to run at specific time right now?
Any advice or guidance is greatly appreciated.
I tried to add the periodic task using app.add_periodic_task
from python interpreter, but it didn't work.
I am looking for some help to run any specific scheduled task at that moment either from Python interpreter or celery command line.
I accomplished this through following two scenarios.
Connect to the related docker instance container where the Celery beat is hosted and run the below commands in Python interpreter
from mymodule.celerybeat import cleanup cleanup.apply_async() <AsyncResult: afd71a7f-2246-4946-8572-267f3494df31>
Using the Celery command line through subcommand call
celery -A myceleryapp:app call mymodule.celerybeat.cleanup
Note: Here myceleryapp is the app name and cleanup is the periodic task.