|
12 | 12 |
|
13 | 13 | import click
|
14 | 14 | from rq.cli import cli as rq_cli
|
| 15 | +from rq.defaults import DEFAULT_RESULT_TTL, DEFAULT_WORKER_TTL |
| 16 | + |
15 | 17 |
|
16 | 18 | try:
|
17 | 19 | from flask.cli import AppGroup, ScriptInfo
|
@@ -117,9 +119,10 @@ def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue,
|
117 | 119 | help='Set logging level')
|
118 | 120 | @click.option('--name', '-n', help='Specify a different name')
|
119 | 121 | @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)') |
123 | 126 | @click.option('--verbose', '-v', is_flag=True, help='Show more output')
|
124 | 127 | @click.option('--quiet', '-q', is_flag=True, help='Show less output')
|
125 | 128 | @click.option('--sentry-dsn', default=None, help='Sentry DSN address')
|
@@ -179,7 +182,7 @@ def resume(rq, ctx):
|
179 | 182 | help='Run in burst mode (quit after all work is done)')
|
180 | 183 | @click.option('-q', '--queue', metavar='QUEUE',
|
181 | 184 | 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, |
183 | 186 | help='How often the scheduler checks for new jobs to add to '
|
184 | 187 | 'the queue (in seconds, can be floating-point for more '
|
185 | 188 | 'precision).')
|
|
0 commit comments