From 3c805ed4a684e38c7079df5c95ccb0360df5d0f1 Mon Sep 17 00:00:00 2001 From: Alex Dong Date: Sun, 29 Sep 2019 07:04:03 +1300 Subject: [PATCH 1/3] Add --max-jobs to worker --- src/flask_rq2/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flask_rq2/cli.py b/src/flask_rq2/cli.py index ab5d2c3..27f65e8 100644 --- a/src/flask_rq2/cli.py +++ b/src/flask_rq2/cli.py @@ -128,6 +128,7 @@ 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') @@ -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, From 243e56dd6cfd26615fd415c69846b29c79f202e8 Mon Sep 17 00:00:00 2001 From: Alex Dong Date: Sun, 29 Sep 2019 07:09:36 +1300 Subject: [PATCH 2/3] Was missing the option in parameter list --- src/flask_rq2/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask_rq2/cli.py b/src/flask_rq2/cli.py index 27f65e8..500e4e0 100644 --- a/src/flask_rq2/cli.py +++ b/src/flask_rq2/cli.py @@ -135,7 +135,7 @@ def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue, @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( From 405f2c718c78248b2b5ec00eb5ffa5fc6ff63fa8 Mon Sep 17 00:00:00 2001 From: Alex Dong Date: Wed, 23 Jun 2021 12:49:44 +1200 Subject: [PATCH 3/3] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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={