diff --git a/setup.py b/setup.py index 7da3826..826a9ab 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ install_requires=[ "Flask>=0.10", "rq>=0.13.0", - "redis>=3.0.0", + "redis>=2.10.6", "rq-scheduler>=0.9.0", ], extras_require={ diff --git a/src/flask_rq2/cli.py b/src/flask_rq2/cli.py index ab5d2c3..500e4e0 100644 --- a/src/flask_rq2/cli.py +++ b/src/flask_rq2/cli.py @@ -128,13 +128,14 @@ def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue, @click.option('--sentry-dsn', default=None, help='Sentry DSN address') @click.option('--exception-handler', help='Exception handler(s) to use', multiple=True) +@click.option('--max-jobs', type=int, default=None, help='Maximum number of jobs to execute') @click.option('--pid', help='Write the process ID number to a file at ' 'the specified path') @click.argument('queues', nargs=-1) @rq_command() def worker(rq, ctx, burst, logging_level, name, path, results_ttl, - worker_ttl, verbose, quiet, sentry_dsn, exception_handler, pid, + worker_ttl, verbose, quiet, max_jobs, sentry_dsn, exception_handler, pid, queues): "Starts an RQ worker." ctx.invoke( @@ -147,6 +148,7 @@ def worker(rq, ctx, burst, logging_level, name, path, results_ttl, worker_ttl=worker_ttl, verbose=verbose, quiet=quiet, + max_jobs=max_jobs, sentry_dsn=sentry_dsn, exception_handler=exception_handler or rq._exception_handlers, pid=pid,