| | |
| | | while True: |
| | | try: |
| | | _datas = huaxin_target_codes_manager.HuaXinL2SubscriptCodesManager.pop() |
| | | timestamp, datas = _datas[0], _datas[1] |
| | | # 只处理20s内的数据 |
| | | if time.time() - timestamp < 20 and datas: |
| | | codes = [d[0] for d in datas] |
| | | for code in codes: |
| | | block_info.init_code(code) |
| | | result = huaxin_trade_api.set_l2_codes_data(datas) |
| | | print("设置L2代码结果:", result) |
| | | if _datas: |
| | | timestamp, datas = _datas[0], _datas[1] |
| | | # 只处理20s内的数据 |
| | | if time.time() - timestamp < 20 and datas: |
| | | codes = [d[0] for d in datas] |
| | | for code in codes: |
| | | block_info.init_code(code) |
| | | result = huaxin_trade_api.set_l2_codes_data(datas) |
| | | print("设置L2代码结果:", result) |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | finally: |