-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Scheduled task name behaviour inconsistent #150
Comments
For now you can just add |
Thanks for the response, I just tried it out. I am using the 0.7.15 release and this will still result in a group named after the schedules pk:
It looks like cluster.scheduler() always overwrites the group keyword in q_options.
In this case the group keyword just gets passed to send_reminder, causing an exception if it doesn't expect a keyword by that name.
I may have misunderstood the suggestion? Thanks again. |
Nope you did not misunderstand. This is just me regretting answering this stuff late at night after a 12 hour shift 👍 |
The current version allows for blank schedule names in the admin. |
Cool, that should do the trick. Without the DB unique constraint on the schedule name people could still do:
Which is actually what I am doing temporarily until he next release. If this isn't a problem then we are good to go. Thanks. |
I've been using django-q for a while now and it is working great. Celery was overkill for me and I really like how django-q can use the orm as a broker.
When creating scheduled tasks sometimes I create them directly using Schedule.objects.create() and sometimes by using the schedule() helper function. I have found it useful to create these tasks with the same name so I can find them by group in the successful/failed model in the django admin. The problem is that sometimes there can be multiple schedules with the same name at the same time.
I probably don't understand the reasons for this behaviour but why not go one way or the other?
-or-
Either of these would keep the instance, helper function, and admin behaviour consistent. As it stands right now I had to change my code to create the Schedule objects directly so I don't get an IntegrityError and can still filter my successful/failed tasks by group.
Thanks.
The text was updated successfully, but these errors were encountered: