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
Add CLI rq
to empty queues and requeue failed jobs
#401
Conversation
Now I have not add rq console_scripts in setup.py, so you can use pyfuncrun to run e.g. $ pyfuncrun rq.scripts.rq.rq --help
$ pyfuncrun rq.scripts.rq.rq empty |
if url is None: | ||
url = "redis://localhost:6379/0" | ||
redis_conn = redis.from_url(url) | ||
use_connection(redis_conn) |
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.
Let's avoid using use_connection
when possible. Instead, we should instantiate queues directly using Redis connections.
1 similar comment
1 similar comment
from rq import get_failed_queue, Queue, Worker | ||
from rq.scripts import (add_standard_arguments, read_config_file, | ||
setup_default_arguments, setup_redis) | ||
from rq.utils import gettermsize, make_colorizer |
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.
You may remove these helper functions from rq.utils
since they aren't used anymore.
@@ -17,7 +17,7 @@ def get_version(): | |||
|
|||
|
|||
def get_dependencies(): | |||
deps = ['redis >= 2.7.0'] | |||
deps = ['redis >= 2.7.0', 'click > 3.0'] |
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.
>=
?
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.
yes >=
, my careless :)
I gotta agree with @selwin that this is looking great :) |
remind to review when you have time :) |
Will try to review soon. Sorry for the wait! |
This PR was great! I changed some subtle things, mostly style fixes, and command descriptions, to be a little more Unix-y, and made sure the default invocation does not do anything implicitly (so people are encouraged to check the Thanks a lot! I'm looking forward to see the |
@nvie yes, it's much conciser, thanks! I will add |
I'm currently restructuring the new CLI code a bit, will commit in a sec. |
Here's my change: b5fbc39. |
@nvie OK, I'll review it, and add |
e.g.