-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Timeout on enqueue not working #117
Comments
I think if timeout is not None:
job.timeout = timeout From @selwin is there any reason it's not implemented like that? |
@lechup I agree with your suggestion, |
Is this problem fixed, as #124 has been merged for a long time now? |
I did see #49 but since it is almost 2 years old I figured I'd create a new one.
I attempted setting a timeout with the following:
my_scheduler = Scheduler('my_task', connection=Redis())
my_scheduler.enqueue(
a_param,
another_param,
**{'timeout': 2700}
)
While this doesn't fail out it still defaults to 3 minutes.
I've tracked down what I believe to be the issue.
enqueue_in calls _create_job and passes in any kwargs.
_create_job then calls create.
create does not use kwargs to get the timeout, it defines it within the function arguments.
enqueue_in either needs to have a timeout argument or this should be in _create_job
try:
timeout = kwargs['timeout']
except KeyError:
timeout = None
I created a fork which features this at https://github.com/SiSTeRTech/rq-scheduler if you'd like to merge
The text was updated successfully, but these errors were encountered: