Skip to content

Commit 0420837

Browse files
authored
Merge pull request #62 from nad2000/issues/58
Update cli.py
2 parents 0afd162 + 0467a87 commit 0420837

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/flask_rq2/cli.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
import click
1414
from rq.cli import cli as rq_cli
15+
from rq.defaults import DEFAULT_RESULT_TTL, DEFAULT_WORKER_TTL
16+
1517

1618
try:
1719
from flask.cli import AppGroup, ScriptInfo
@@ -117,9 +119,10 @@ def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue,
117119
help='Set logging level')
118120
@click.option('--name', '-n', help='Specify a different name')
119121
@click.option('--path', '-P', default='.', help='Specify the import path.')
120-
@click.option('--results-ttl', help='Default results timeout to be used')
121-
@click.option('--worker-ttl', type=int,
122-
help='Default worker timeout to be used')
122+
@click.option('--results-ttl', type=int, default=DEFAULT_RESULT_TTL,
123+
help='Default results timeout to be used')
124+
@click.option('--worker-ttl', type=int, default=DEFAULT_WORKER_TTL,
125+
help='Default worker timeout to be used (default: 420)')
123126
@click.option('--verbose', '-v', is_flag=True, help='Show more output')
124127
@click.option('--quiet', '-q', is_flag=True, help='Show less output')
125128
@click.option('--sentry-dsn', default=None, help='Sentry DSN address')
@@ -179,7 +182,7 @@ def resume(rq, ctx):
179182
help='Run in burst mode (quit after all work is done)')
180183
@click.option('-q', '--queue', metavar='QUEUE',
181184
help='The name of the queue to run the scheduler with.')
182-
@click.option('-i', '--interval', metavar='SECONDS',
185+
@click.option('-i', '--interval', metavar='SECONDS', type=int,
183186
help='How often the scheduler checks for new jobs to add to '
184187
'the queue (in seconds, can be floating-point for more '
185188
'precision).')

0 commit comments

Comments
 (0)