Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Added optional timeout parameter to the job decorator. #7

Closed
wants to merge 1 commit into from
Closed

Added optional timeout parameter to the job decorator. #7

wants to merge 1 commit into from

Conversation

samzscott
Copy link

Added support for an optional timeout parameter to the job decorator so one may override the redis default of 180 seconds. Does not affect past implementations that use flask-rq. Added an example and entry to the readme accordingly.

…fect past implementations that use flask-rq. Added an example and entry to the readme accordingly.
@CEWendel
Copy link

+1

if timeout is None:
return q.enqueue(fn, *args, **kwargs)
else:
return q.enqueue_call(func=fn, args=args, kwargs=kwargs, timeout=timeout)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be using the default_timeout argument name since RQ 0.3.0 - http://python-rq.org/docs/results/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enqueue also has a timeout param so I don't think this if statement is needed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need this change too. I was adding it myself in my code base.

I see the PR is dead due to a connection failure https://travis-ci.org/mattupstate/flask-rq/jobs/29826186#L88

This is very useful. Seems its been a while, may we please resurrect the thread?

Please let me know if this needs help.

@rkubik
Copy link

rkubik commented Jan 28, 2016

Bump. This is very useful, any progress on this?

@mschmo I don't think so. default_timeout is for the whole queue not individual jobs.

@mschmo
Copy link

mschmo commented Jan 28, 2016

@rkubik I reread the documentation in the link I posted and I agree with you. Not sure what I was thinking at the time, but that was 9 months ago so who knows.

@cburmeister
Copy link

Would love to see this land on master -- anything I can do to help?

@samzscott samzscott closed this May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants