From 8aa2c7b5473b99bbfedd2736aa208321fcd5afae Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 23 Oct 2013 12:02:42 -0400 Subject: [PATCH] Make the purge_queue management command more efficient Before we were removing items individually from the queue. We now directly use RabbitMQ's queue purging mechanism. (imported from commit 62ab52c724c5a221b4c81a967154a4046a579f84) --- zerver/management/commands/purge_queue.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/management/commands/purge_queue.py b/zerver/management/commands/purge_queue.py index c1659c0584..0970d22147 100644 --- a/zerver/management/commands/purge_queue.py +++ b/zerver/management/commands/purge_queue.py @@ -14,4 +14,6 @@ class Command(BaseCommand): queue_name = args[0] queue = SimpleQueueClient() - queue.drain_queue(queue_name) + queue.ensure_queue(queue_name, lambda: None) + queue.channel.queue_purge(queue_name) + print "Done"