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
Allow passing backend classes from CLI and other APIs #786
Conversation
3 similar comments
@@ -626,7 +626,7 @@ class TimeoutTestCase: | |||
def setUp(self): | |||
# we want tests to fail if signal are ignored and the work remain | |||
# running, so set a signal to kill them after X seconds | |||
self.killtimeout = 10 | |||
self.killtimeout = 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this was the only way I was able to fix a slow subprocess call in the pypy env on Travis CI.
@@ -123,7 +124,7 @@ def create(cls, func, args=None, kwargs=None, connection=None, | |||
job._instance = func | |||
job._func_name = '__call__' | |||
else: | |||
raise TypeError('Expected a callable or a string, but got: {}'.format(func)) | |||
raise TypeError('Expected a callable or a string, but got: {0}'.format(func)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change needed to work on Python 2.6.
Wow, this is a big PR. I'll need some time to review this. If possible, next time please split them into smaller, logically grouped PRs :) |
@selwin I'm sorry for the size but I don't see how I could have cut the PR for passing the backend classes into smaller chunks, it just was in a lot of places missing. I'd be happy to update the patch if there is a better way to handle passing around those classes of course. |
…LI and other APIs This includes: - a partial refactor of the CLI to organize the shared options - extends the tests in areas where passing custom backend classes makes sense - allow setting the core CLI options as env vars - minor cosmetic changes here and there
3 similar comments
Thanks for the PR @jezdez ! |
@selwin Happy to :) |
This is related to rq/Flask-RQ2#2 and rq/Flask-RQ2#12. While debugging those issues I've found many inconsistencies how the backend classes are used throughout the RQ code base, basically making it currently impossible to fully override job, queue, worker or connection classes.
This should be backward-compatible, but any testing in real-world projects would be appreciated.