From 123366b3a5e37174df63fdaf3581952f5ceffd7d Mon Sep 17 00:00:00 2001 From: Mehmed Mustafa Date: Mon, 27 Mar 2023 18:12:38 +0200 Subject: [PATCH] bruh, I need some rest for today Fix the silly mistake I made. --- ocrd_network/ocrd_network/processing_server.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ocrd_network/ocrd_network/processing_server.py b/ocrd_network/ocrd_network/processing_server.py index 988480ee3f..3e01c63e14 100644 --- a/ocrd_network/ocrd_network/processing_server.py +++ b/ocrd_network/ocrd_network/processing_server.py @@ -228,18 +228,17 @@ async def push_processor_job(self, processor_name: str, data: PYJobInput) -> PYJ if processor_name not in self.processor_list: try: - # Only checks if the process queue exists, if not raises ValueError + # Only checks if the process queue exists, if not raises ChannelClosedByBroker self.rmq_publisher.create_queue(processor_name, passive=True) except ChannelClosedByBroker as error: self.log.warning(f"Process queue with id '{processor_name}' not existing: {error}") + # Reconnect publisher - not efficient, but works + # TODO: Revisit when reconnection strategy is implemented + self.connect_publisher(enable_acks=True) raise HTTPException( status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=f"Process queue with id '{processor_name}' not existing" ) - finally: - # Reconnect publisher - not efficient, but works - # TODO: Revisit when reconnection strategy is implemented - self.connect_publisher(enable_acks=True) # validate additional parameters if data.parameters: