| | |
| | | from db import mysql_data |
| | | from db.redis_manager import RedisUtils, RedisManager |
| | | from log import logger_debug, logger_request_debug |
| | | from middle_l1_data_server import L1DataManager |
| | | from output import push_msg_manager |
| | | from utils import socket_util, kpl_api_util, hosting_api_util, kp_client_msg_manager, global_data_cache_util, tool |
| | | from utils.juejin_util import JueJinHttpApi |
| | |
| | | print("l2_subscript_codes", data_json) |
| | | global_data_cache_util.huaxin_subscript_codes = datas |
| | | global_data_cache_util.huaxin_subscript_codes_update_time = tool.get_now_time_str() |
| | | finally: |
| | | sk.sendall(socket_util.load_header(json.dumps({"code": 0}).encode(encoding='utf-8'))) |
| | | elif data_json["type"] == "l2_position_subscript_codes": |
| | | # 设置订阅的代码 |
| | | try: |
| | | data = data_json["data"] |
| | | datas = data["data"] |
| | | print("l2_position_subscript_codes", data_json) |
| | | global_data_cache_util.huaxin_position_subscript_codes = datas |
| | | global_data_cache_util.huaxin_position_subscript_codes_update_time = tool.get_now_time_str() |
| | | finally: |
| | | sk.sendall(socket_util.load_header(json.dumps({"code": 0}).encode(encoding='utf-8'))) |
| | | elif data_json["type"] == "redis": |
| | |
| | | push_msg_manager.push_msg(_type, data) |
| | | result_str = json.dumps({"code": 0, "data": {}}) |
| | | sk.sendall(socket_util.load_header(result_str.encode(encoding='utf-8'))) |
| | | elif data_json["type"] == 'l1_data': |
| | | datas = data_json["data"] |
| | | L1DataManager.add_datas(datas) |
| | | break |
| | | except Exception as e: |
| | | log.logger_tuoguan_request_debug.exception(e) |
| | | finally: |