(amqp_context, queue, if_unused, if_empty)
| 194 | default=False) |
| 195 | @click.pass_obj |
| 196 | def queue_delete(amqp_context, queue, if_unused, if_empty): |
| 197 | if amqp_context.channel is None: |
| 198 | amqp_context.echo_error('Not connected to broker. Please retry...') |
| 199 | amqp_context.reconnect() |
| 200 | else: |
| 201 | try: |
| 202 | retval = amqp_context.channel.queue_delete(queue=queue, |
| 203 | if_unused=if_unused, |
| 204 | if_empty=if_empty) |
| 205 | except Exception as e: |
| 206 | amqp_context.echo_error(e) |
| 207 | amqp_context.reconnect() |
| 208 | else: |
| 209 | amqp_context.cli_context.secho( |
| 210 | f'{retval} messages deleted.', |
| 211 | fg='cyan', bold=True) |
| 212 | amqp_context.echo_ok() |
| 213 | |
| 214 | |
| 215 | @amqp.command(name='queue.purge') |
nothing calls this directly
no test coverage detected