From 468431f3d4d65093fc061e01eed2256cf83470bd Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 15 八月 2023 15:59:57 +0800
Subject: [PATCH] ++++++++++++++++ bug修复-

---
 huaxin_api/l2_client.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/huaxin_api/l2_client.py b/huaxin_api/l2_client.py
index 50a3beb..8a3025b 100644
--- a/huaxin_api/l2_client.py
+++ b/huaxin_api/l2_client.py
@@ -523,7 +523,7 @@
 
 def __receive_from_pipe_strategy(pipe_):
     while True:
-        print("__receive_from_pipe_strategy")
+        # print("__receive_from_pipe_strategy")
         try:
             val = pipe_.recv()
             if val:
@@ -537,22 +537,24 @@
 
 
 def run(pipe_trade, pipe_strategy):
-    __init_l2()
     if pipe_trade is not None:
         t1 = threading.Thread(target=lambda: __receive_from_pipe_trade(pipe_trade), daemon=True)
         t1.start()
     if pipe_strategy is not None:
-        t1 = threading.Thread(target=lambda: __receive_from_pipe_strategy(pipe_strategy), daemon=True)
+        t1 = threading.Thread(target=__receive_from_pipe_strategy, args=(pipe_strategy,), daemon=True)
         t1.start()
+    __init_l2()
     l2_data_manager.run_upload_common()
     global l2CommandManager
     l2CommandManager = command_manager.L2CommandManager()
     l2CommandManager.init(MyL2ActionCallback())
-
     print("l2_client鍚姩鎴愬姛")
+    while True:
+        time.sleep(2)
+
 
 
 if __name__ == "__main__":
-    run(None,None)
+    run(None, None)
     # spi.set_codes_data([("000333", 12000)])
     input()

--
Gitblit v1.8.0