From 4aa9c59da24842fc665a94ca4e14d70a24ab7482 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Tue, 6 Aug 2024 13:27:26 +0800 Subject: [PATCH] Fix worker break issue (#10) --- servers/simple/server.py | 2 +- servers/simple/worker.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/simple/server.py b/servers/simple/server.py index 0b92e30..5b55ba8 100644 --- a/servers/simple/server.py +++ b/servers/simple/server.py @@ -82,7 +82,7 @@ async def feedRawData(self, request, context): # It should not be called return Empty() - uris = [str(uri.name) for uri in request.unrecognizedUris] + uris = [str(uri.name) for uri in request.unrecognizedUris if uri and uri.name] service = str(request.service) # This is an experimental mechanism to avoid identifying non-restful uris unnecessarily. diff --git a/servers/simple/worker.py b/servers/simple/worker.py index da7361a..9ce0435 100644 --- a/servers/simple/worker.py +++ b/servers/simple/worker.py @@ -52,5 +52,7 @@ def run_worker(uri_main_queue, shared_results_object): # increment here counter += 1 print('-================-') + except Exception as e: + print(f"catch an unexpected error occurred: {e}") except queue.Empty: # TODO Consider queue full pass