Skip to content

Commit

Permalink
removed extra pika calls in process model loop
Browse files Browse the repository at this point in the history
  • Loading branch information
asaxton committed Aug 15, 2024
1 parent 9e728b8 commit 8b843ae
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions downloader/CM_B_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8b843ae

Please sign in to comment.