1

I'm using django-q to schedule monthly event for sending emails. After several testing runs, I realized that each time I execute the:

Schedule.objects.create(func='app.email.send_monthly_email',schedule_type=Schedule.MONTHLY,repeats=-1)

this schedule event is cached and it will run the next time I start qcluster. How to I delete all the scheduled tasks in django-q? Or how can I have a clean start every time I run qcluster?

minda
  • 13
  • 3

2 Answers2

3

You can open the database shell using

python manage.py dbshell

And then use an SQL command :

DELETE FROM django_q_schedule

Remember that this will delete All Scheduled Tasks

0

Open Django ORM Shell

from django_q.models import Schedule

Here, you can see all your scheduled jobs

Schedule.objects.all()

To delete,

job = Schedule.objects.get(id=<job_id>)
job.delete()
deep
  • 91
  • 3