Replies: 3 comments 1 reply
-
I'd not considered the need to document it, but currently yes it's assumed that There might be an argument for capping it to something sensible, so people are encouraged to use something like cron (which is probably more applicable for that use-case), but I don't think that's necessary. |
Beta Was this translation helpful? Give feedback.
-
I think it's important to document, because otherwise people who write back-end plugins later may assume that they can get away with things like taking any task from the queue and if it turns out it's deferred then A cap is not unreasonable, but if there is one I think it should be at least a month (i.e. 32 x 86400 seconds). cron (which I think I've already mentioned is something I think django-tasks should be supporting natively, like celerybeat) is great for doing things like "once every day, process payments for customer renewals happening that day" but useless for things like "send an email to newly registered users 1 hour, 48 hours, and 72 hours after they register". |
Beta Was this translation helpful? Give feedback.
-
Documenting is probably the way to go then. PRs welcome 🙂
Not quite true. A cron task which runs every hour, finds the users which registered an hour ago, and emails them, is perfectly sensible. In fact, i'd tend towards implementing a feature that way rather than using |
Beta Was this translation helpful? Give feedback.
-
Just a note to make sure django-tasks doesn't make the same mistake that celery did...
celery introduced
eta
/countdown
in 2009. These allow you to do the equivalent of DEP-0014's "deferred tasks". That's a great feature.In 2023, thirteen years later, they changed the documentation for this feature to say "Oh, sorry, didn't we say, you can't actually defer tasks for more than a minute or two at most? It may appear to work but will cause all sorts of subtle problems later. We probably should have mentioned that. But we didn't. Sucks to be you".
So, django-tasks should either:
Beta Was this translation helpful? Give feedback.
All reactions