Open RajuSingh-cmyk opened 3 years ago
Try setting Schedule.next_run to the first time you want it to run.
Your code indicates it gets set to timezone.now (the default, since you are not setting it explicitly )
@jyoost Thanks for the help!! The second issue of immediate task execution is resolved by using next_run.
Could you please suggest a work around for first issue, i.e creating new entries everytime the development server is redeployed?
Schedules are just a django model so you can treat them like any other startup data:
i want to run djangoq-scheduler on every weekend but having two issues with it-:
i) creating two entries in django_q_scheduler models as soon as i run development server and qcluster
ii) scheduler starts executing immediately as soon as entry is created in the model, instead of executing on every weekend.
Here is the code used -:
Django-Q Cluster
Q_CLUSTER = {
}
Schedule.objects.create(func='func()',
Version Used -
python-> 3.6.8
django-q -> 1.3.4
Database- postgres
OS - Linux
Any help would be greatly appreciated.