2 # -*- coding: utf-8 -*-
4 # This program drains all the queues, throwing away all the messages.
5 # Note that messages which are being processed are not and cannot be
11 connection = pika.BlockingConnection(pika.ConnectionParameters(
12 host = config.mq_server))
13 channel = connection.channel()
16 method, _, _ = channel.basic_get(queue = 'patchq_input', no_ack = True)
19 for t in config.tests:
20 qname = "patchq_test_%s" % t
22 method, _, _ = channel.basic_get(queue = qname, no_ack = True)
26 method, _, _ = channel.basic_get(queue = 'patchq_reports', no_ack = True)
29 print "All queues drained."