MCPcopy Create free account
hub / github.com/celery/celery / queue_delete

Function queue_delete

celery/bin/amqp.py:196–212  ·  view source on GitHub ↗
(amqp_context, queue, if_unused, if_empty)

Source from the content-addressed store, hash-verified

194 default=False)
195@click.pass_obj
196def 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')

Callers

nothing calls this directly

Calls 4

echo_errorMethod · 0.80
sechoMethod · 0.80
echo_okMethod · 0.80
reconnectMethod · 0.45

Tested by

no test coverage detected