|
|
@ -3,18 +3,17 @@
|
|
|
|
from __future__ import (absolute_import, division, print_function,
|
|
|
|
from __future__ import (absolute_import, division, print_function,
|
|
|
|
unicode_literals)
|
|
|
|
unicode_literals)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import click
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
from functools import partial
|
|
|
|
from functools import partial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import click
|
|
|
|
from redis.exceptions import ConnectionError
|
|
|
|
from redis.exceptions import ConnectionError
|
|
|
|
from rq import get_failed_queue, Queue, Worker, Connection
|
|
|
|
from rq import Connection, get_failed_queue, Queue, Worker
|
|
|
|
from rq.scripts import (add_standard_arguments, read_config_file,
|
|
|
|
from rq.scripts import (add_standard_arguments, read_config_file,
|
|
|
|
setup_default_arguments, setup_redis)
|
|
|
|
setup_default_arguments, setup_redis)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
red = partial(click.style, fg='red')
|
|
|
|
red = partial(click.style, fg='red')
|
|
|
|
green = partial(click.style, fg='green')
|
|
|
|
green = partial(click.style, fg='green')
|
|
|
|
yellow = partial(click.style, fg='yellow')
|
|
|
|
yellow = partial(click.style, fg='yellow')
|
|
|
@ -184,7 +183,7 @@ def info(ctx, path, interval, raw, only_queues, only_workers, by_queue, queues):
|
|
|
|
sys.exit(0)
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### The following code is for backward compatibility, will be removed in future
|
|
|
|
# TODO: The following code is for backward compatibility, should be removed in future
|
|
|
|
def parse_args():
|
|
|
|
def parse_args():
|
|
|
|
parser = argparse.ArgumentParser(description='RQ command-line monitor.')
|
|
|
|
parser = argparse.ArgumentParser(description='RQ command-line monitor.')
|
|
|
|
add_standard_arguments(parser)
|
|
|
|
add_standard_arguments(parser)
|
|
|
@ -198,11 +197,12 @@ def parse_args():
|
|
|
|
parser.add_argument('queues', nargs='*', help='The queues to poll')
|
|
|
|
parser.add_argument('queues', nargs='*', help='The queues to poll')
|
|
|
|
return parser.parse_args()
|
|
|
|
return parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
# warn users this command is deprecated, use `rq info`
|
|
|
|
# warn users this command is deprecated, use `rq info`
|
|
|
|
import warnings
|
|
|
|
import warnings
|
|
|
|
warnings.simplefilter('always', DeprecationWarning)
|
|
|
|
warnings.simplefilter('always', DeprecationWarning)
|
|
|
|
warnings.warn("This command will be remove in future, "
|
|
|
|
warnings.warn("This command will be removed in future, "
|
|
|
|
"use `rq info` instead", DeprecationWarning)
|
|
|
|
"use `rq info` instead", DeprecationWarning)
|
|
|
|
|
|
|
|
|
|
|
|
args = parse_args()
|
|
|
|
args = parse_args()
|
|
|
|