From e8c8451aa2028793d0ed0a9e5cf5cbb230f21221 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 28 八月 2023 10:20:59 +0800
Subject: [PATCH] 端口日志

---
 ocr/ocr_server.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ocr/ocr_server.py b/ocr/ocr_server.py
index 9e8860a..b8886d4 100644
--- a/ocr/ocr_server.py
+++ b/ocr/ocr_server.py
@@ -6,6 +6,7 @@
 import numpy
 
 import constant
+from log_module.log import logger_system
 from utils import ths_industry_util
 from ocr import ocr_util
 from third_data import kpl_util
@@ -157,7 +158,11 @@
     handler = OCRServer
     httpd = socketserver.TCPServer((addr, port), handler)
     print("HTTP server is at: http://%s:%d/" % (addr, port))
-    httpd.serve_forever()
+    try:
+        httpd.serve_forever()
+    except Exception as e:
+        logger_system.exception(e)
+        logger_system.error(f"绔彛鏈嶅姟鍣細{port} 鍚姩澶辫触")
 
 
 if __name__ == "__main__":

--
Gitblit v1.8.0