Commit 0d9fd2f7 by ‘chizw’

[+]进程池优化

1 parent 87f64278
...@@ -70,14 +70,15 @@ class model_output(): ...@@ -70,14 +70,15 @@ class model_output():
def handle_process(message: str): def handle_process(message: str):
try: try:
process = multiprocessing.current_process()
log.info( log.info(
f"handle_process_start process_name:{multiprocessing.current_process()},thread name:{threading.current_thread().name}," f"handle_process_start process:{process},thread name:{threading.current_thread().name},"
f"Received task_id: {message}") f"Received task_id: {message}")
# 处理逻辑 # 处理逻辑
start_time = time.time() start_time = time.time()
task_id = json.loads(message)["task_id"] task_id = json.loads(message)["task_id"]
deal_worker(task_id) deal_worker(task_id)
log.info(f"handle_process_end task_id:{task_id} 耗时:" + str(time.time() - start_time)) log.info(f"handle_process_end process:{process} task_id:{task_id} 耗时:" + str(time.time() - start_time))
except Exception as e: except Exception as e:
log.error("funasr handle_process Exception: " + str(traceback.format_exc())) log.error("funasr handle_process Exception: " + str(traceback.format_exc()))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!