From 8b843ae6f650d5dd2946ad1d11aaf19080f5ed51 Mon Sep 17 00:00:00 2001 From: asaxton Date: Wed, 14 Aug 2024 21:59:13 -0500 Subject: [PATCH] removed extra pika calls in process model loop --- downloader/CM_B_downloader.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/downloader/CM_B_downloader.py b/downloader/CM_B_downloader.py index d859d3f..2b25bba 100755 --- a/downloader/CM_B_downloader.py +++ b/downloader/CM_B_downloader.py @@ -60,6 +60,7 @@ def process(self, method, properties, body_in): self.exception = None def run(self): + self.output_model_list.clear() try: CDR_catalog = json.loads(self.body_in) print("about to print catalog") @@ -333,12 +334,8 @@ def main(argv): print(f"sending process request for model {model_to_process}") my_process_queue = process_queue_base+model_to_process outgoing_message=json.dumps(my_output_dictionary) - parameters = pika.URLParameters(rabbitmq_uri) - connection = pika.BlockingConnection(parameters) - channel = connection.channel() channel.queue_declare(queue=my_process_queue, durable=True) - properties = pika.BasicProperties(delivery_mode=pika.DeliveryMode.Persistent) - channel.basic_publish(exchange='', routing_key=my_process_queue, body=outgoing_message, properties=properties) + channel.basic_publish(exchange='', routing_key=my_process_queue, body=outgoing_message, properties=worker.properties) channel.basic_ack(delivery_tag=worker.method.delivery_tag) worker = None