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)
This commit is contained in:
Zev Benjamin 2013-10-23 12:02:42 -04:00
parent 32da8ecff4
commit 8aa2c7b547

View File

@ -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"