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
Passing timeout to queued job #16
Comments
I've asked about this here: http://stackoverflow.com/questions/15445036/rqworker-timeout |
It seems what is needed from my very quick perusal of the rq and django-rq code base, is a enqueue_call(...) method in django-rq's queue.py module that parallels rq's queue.py module here: https://github.com/nvie/rq/blob/5a5e14cc70bca19458070665eef753b9b2db78f5/rq/queue.py#L116. Then we could pass a timeout value to rq through django-rq. |
Yes, queue = get_queue('default')
queue.enqueue(long_running_func, timeout=500) I'm gonna close this issue, but feel free to open it again if you're having troubles. |
If I do that, |
I tried this and I think it is working. Thanks for your help.
|
Sorry for the late reply. Try this: queue.enqueue(populate_trends, args=[self], timeout=500) |
That doens't seem to work. I get an |
https://github.com/nvie/rq/blob/5a5e14cc70bca19458070665eef753b9b2db78f5/rq/job.py#L75 enforces args to be a queue.enqueue(populate_trends, args=(self,), timeout=500) |
Yep, that syntax seems to do the trick. Interesting -- thanks again for the help. |
Hello, don't you want to make it an argument of It doesn't really look good when you change something like this I believe we just need to expose this argument and pass it to the |
Agreed with @irqed. |
@irqed @freeyoung you should already be able to pass |
@selwin @freeyoung nope, it didn't in some reason. But as you can see I've made a comment about 7 months ago. Even the link isn't correct anymore. Didn't use it since that project. |
@irqed sorry, I must have missed your comment. I only visited this thread again when Github sent me an email of @freeyoung's comment yesterday. So it didn't work for you seven months ago, correct? If that's the case, it must have been a bug in RQ back then. All along, Django RQ has accepted all |
@selwin @freeyoung yeah, I see that it should work properly. Sorry but I don't remember how I came up with this conclusion. I can't test it against that codebase anymore, I left the company. But I'll try to test it on the weekend. |
Thanks a lot. Much appreciated :) Sent from my phone
|
update for those of you finding this page from a search engine. The
|
@ccurvey == saviour |
Is it possible to pass a timeout value to an enqueued job? I believe the default is 180 seconds -- which is short for some long-running jobs.
Thanks for the great tool!
The text was updated successfully, but these errors were encountered: