-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scheduling repeating tasks #121
Comments
When you have a django application running and you somewhere import the tasks.py Meaning if your cluster is turned off or you have a failing task, the count wil go up (negative way) |
Ah, okay. Is there a better place to put schedules than in tasks.py? |
Unlike some other packages, Django-Q doesn't actually import anything at startup, but it will look for existing schedules in the database. If you're just working on a single project I would just create the schedule in the admin or via the Django shell. However if you're planning on distributing your code, you should create the schedule in an initial setup step or, as described above, make sure you don't create it twice. @Eagllus is right. When the repeating number is negative, the schedule will run forever but will still decrease that number the same way a number run would. I left it like that cause the negative number is a good indication of how often your schedule has been executed. |
Cool, this makes sense to me now, thanks for clearing that up. Loving Django-Q, by the way. Amazing work! |
I'm having difficulty scheduling a repeating task. I placed this in tasks.py, but it never gets called.
If I add the task from the Django admin, it gets called once, but then the repeating number decreases to -2 and it never runs again. What am I doing wrong here?Apparently it is running again, I'm just impatient. I'd like to schedule it via code, though. Is there something wrong with the way I wrote it?
The text was updated successfully, but these errors were encountered: