| Conditions | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python |
||
| 8 | 1 | @click.command(help=''' |
|
| 9 | Start an impulsare worker |
||
| 10 | |||
| 11 | In case of error, try ``queue-listener --debug -c my_config.yml`` |
||
| 12 | ''', name='queue-listener') |
||
| 13 | 1 | @click.option('--debug/--no-debug', '-d', default=False) |
|
| 14 | 1 | @click.option('--host', '-h', required=True, help='Host') |
|
| 15 | 1 | @click.option('--port', '-p', default=6379, help='Redis Port') |
|
| 16 | 1 | @click.option('--queue', '-q', required=True, help='Queue to listen') |
|
| 17 | 1 | def cli(debug: bool, host: str, port: int, queue: str): |
|
|
|
|||
| 18 | 1 | with Connection(Redis(host, port)): |
|
| 19 | 1 | Worker(queue).work() |
|
| 20 | |||
| 36 |