Skip to content
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 option to disable job description logging #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/flask_rq2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue,
help='Default results timeout to be used')
@click.option('--worker-ttl', type=int, default=DEFAULT_WORKER_TTL,
help='Default worker timeout to be used (default: 420)')
@click.option('--disable-job-desc-logging', is_flag=True, help='Turn off description logging.')
@click.option('--verbose', '-v', is_flag=True, help='Show more output')
@click.option('--quiet', '-q', is_flag=True, help='Show less output')
@click.option('--sentry-dsn', default=None, help='Sentry DSN address')
Expand All @@ -134,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, disable_job_desc_logging, verbose, quiet, sentry_dsn, exception_handler, pid,
queues):
"Starts an RQ worker."
ctx.invoke(
Expand All @@ -145,6 +146,7 @@ def worker(rq, ctx, burst, logging_level, name, path, results_ttl,
path=path,
results_ttl=results_ttl,
worker_ttl=worker_ttl,
disable_job_desc_logging=disable_job_desc_logging,
verbose=verbose,
quiet=quiet,
sentry_dsn=sentry_dsn,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_worker_command(config, rq_cli_app, cli_runner, caplog):
obj = ScriptInfo(create_app=lambda info: rq_cli_app)
result = cli_runner.invoke(rq_cli_app.cli,
args=['rq', 'worker', '--burst',
'--worker-ttl', '10'],
'--worker-ttl', '10', '--disable-job-desc-logging'],
obj=obj)
assert result.exit_code == 0
out = caplog.text
Expand Down