From 7f026a4d59ee64f80f86cd5ee8601e96f27bd2ad Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 11 一月 2024 15:28:55 +0800
Subject: [PATCH] 添加测试

---
 huaxin_client/l2_client.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/huaxin_client/l2_client.py b/huaxin_client/l2_client.py
index 054d3b4..20a8301 100644
--- a/huaxin_client/l2_client.py
+++ b/huaxin_client/l2_client.py
@@ -6,6 +6,7 @@
 import queue
 import threading
 import time
+import concurrent.futures
 from typing import List
 
 from huaxin_client import command_manager, l2_data_transform_protocol
@@ -491,8 +492,7 @@
 class MyL2ActionCallback(L2ActionCallback):
 
     def OnSetL2Position(self, codes_data):
-        print("L2璁㈤槄鏁伴噺锛�", len(codes_data))
-        logger_l2_codes_subscript.info("鍗庨懌L2浠g爜澶勭悊闃熷垪鑾峰彇鍒版暟鎹細鏁伴噺-{}", len(codes_data))
+        huaxin_l2_log.info(logger_l2_codes_subscript, "鍗庨懌L2浠g爜澶勭悊闃熷垪鑾峰彇鍒版暟鎹細鏁伴噺-{}", len(codes_data))
         try:
             spi.set_codes_data(codes_data)
         except Exception as e:
@@ -532,6 +532,9 @@
     api.Init()
 
 
+__l2_cmd_thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=3)
+
+
 def __receive_from_queue_trade(queue_trade_w_l2_r: multiprocessing.Queue):
     logger_system.info(f"l2_client __receive_from_pipe_trade 绾跨▼ID:{tool.get_thread_id()}")
     while True:
@@ -547,7 +550,10 @@
                     code = data["data"]["code"]
                     spi.set_code_special_watch_volume(code, volume)
                 elif _type == "l2_cmd":
-                    l2CommandManager.process_command(command_manager.CLIENT_TYPE_CMD_L2, None, data)
+                    # 绾跨▼姹�
+                    __l2_cmd_thread_pool.submit(
+                        lambda: l2CommandManager.process_command(command_manager.CLIENT_TYPE_CMD_L2, None, data))
+
         except Exception as e:
             logging.exception(e)
 

--
Gitblit v1.8.0