Is there any way to make periodic_task
to run on call only, I see Pingit()
starts as soon as i run my django-app python manage.py runserver
@periodic_task(run_every=crontab(minute="*/1"),options={"task_id":task_name})
def Pingit():
print('Every Minute Im Called')
I Would like to make it run the periodic task only if i call it by Pingit
.
You may be better to use a
@task
for this and get it to re-queue itself after it executes, for example:If you need to add positional arguments to the function, you can specify those with
args
. For example, to pass aname
argument: