-
-
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
Periodic tasks add only if #320
Comments
Would it be possible to have this task schedule a second task which exectes the long-running code? That way, the task that is scheduled to run every 5 minutes can check the current queue, and decide whether to schedule another long-running task. Either way, it will finish relatively quickly. |
That will probably work. Will give it a go. Thanks! Still think it might be nice feature though, if it is not too much work. |
~~I cannot get this to work. I need to pass an object into the function, which is causing me problems, since it can not be pickled I rewrote the project a bit so this will work. But I cannot find how to acces the queue in te manual. Can you give me a little tip whith this?~~ Found it, you can acces the queue with |
I use django-q for some background tasks. The tasks looks like this in pseudocode
If I run the task every 5 minutes and param == False for a few times in a row I will create a lot of tasks and my queue will overflow. Is there a way that only a new task is created if there is no task running, taking into consideration the timeout?
The text was updated successfully, but these errors were encountered: