From 06af5d478a75da7973d639739f921dc3554f6c44 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 15 四月 2024 16:38:03 +0800 Subject: [PATCH] 添加L1数据采集 --- huaxin_client/l1_client_for_output.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/huaxin_client/l1_client_for_output.py b/huaxin_client/l1_client_for_output.py index 9237bd8..b4c6a8b 100644 --- a/huaxin_client/l1_client_for_output.py +++ b/huaxin_client/l1_client_for_output.py @@ -119,9 +119,9 @@ def __upload_codes_info(datas): - if not tool.is_trade_time(): - return - data_bytes = socket_util.load_header(json.dumps({"type": "l1_data", "data": datas})) + # if not tool.is_trade_time(): + # return + data_bytes = socket_util.load_header(json.dumps({"type": "l1_data", "data": datas}).encode("utf-8")) # 涓婁紶鏁版嵁 sk = socket_util.create_socket(SERVER_HOST, SERVER_PORT) try: @@ -154,6 +154,7 @@ def test_add_datas(): while True: + print("鍙戦�佹祴璇曟暟鎹�") level1_data_queue.put_nowait(("000948", 12.91, 14.20, int(34.60 * 10000), 4.9 * 1e8, tool.get_now_time_str())) time.sleep(3) @@ -206,8 +207,8 @@ # "000969", 9.46, 9.11, 771000*100, time.time()) # level1_data_dict["002292"] = ( # "002292", 8.06, 9.96, 969500 * 100, time.time()) - # TODO:娴嬭瘯 - threading.Thread(target= lambda: test_add_datas(), daemon=True).start() + # 娴嬭瘯 + # threading.Thread(target= lambda: test_add_datas(), daemon=True).start() # 绛夊緟绋嬪簭缁撴潫 while True: try: -- Gitblit v1.8.0