Administrator
2024-04-15 06af5d478a75da7973d639739f921dc3554f6c44
添加L1数据采集
1个文件已修改
11 ■■■■ 已修改文件
huaxin_client/l1_client_for_output.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: