Administrator
2023-09-14 a29622874377f194aa83b5c51422d7ce5516bd9c
线程ID记录
7个文件已修改
30 ■■■■ 已修改文件
huaxin_client/l2_client.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/l2_data_manager.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/async_log_util.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
outside_api_command_manager.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_api.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/l2_trade_util.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/l2_client.py
@@ -546,6 +546,7 @@
def __receive_from_pipe_trade(pipe):
    logger_system.info(f"l2_client __receive_from_pipe_trade 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            value = pipe.recv()
@@ -561,6 +562,7 @@
def __receive_from_pipe_strategy(pipe_):
    logger_system.info(f"l2_client __receive_from_pipe_strategy 线程ID:{tool.get_thread_id()}")
    while True:
        # print("__receive_from_pipe_strategy")
        try:
huaxin_client/l2_data_manager.py
@@ -15,7 +15,8 @@
from huaxin_client.l2_data_transform_protocol import L2DataCallBack
from log_module import log_export, async_log_util
from log_module.log import logger_local_huaxin_l2_error, logger_local_huaxin_l2_upload, logger_local_huaxin_l2_buy_no, \
    logger_local_huaxin_g_cancel, hx_logger_contact_debug
    logger_local_huaxin_g_cancel, hx_logger_contact_debug, logger_system
from utils import tool
order_detail_upload_active_time_dict = {}
transaction_upload_active_time_dict = {}
@@ -229,6 +230,7 @@
def __run_upload_common(l2_data_callback: L2DataCallBack):
    print("__run_upload_common")
    logger_system.info(f"l2_client __run_upload_common 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            while not common_queue.empty():
@@ -247,6 +249,7 @@
def __run_upload_trading_canceled(l2_data_callback: L2DataCallBack):
    print("__run_upload_trading_canceled")
    logger_system.info(f"l2_client __run_upload_trading_canceled 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            temp = trading_canceled_queue.get()
@@ -262,6 +265,7 @@
def __run_log():
    print("__run_log")
    logger_system.info(f"l2_client __run_log 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            temp = log_buy_no_queue.get()
@@ -316,6 +320,7 @@
# 运行守护线程
def run_upload_daemon(_l2_data_callback):
    def upload_daemon():
        logger_system.info(f"l2_client upload_daemon 线程ID:{tool.get_thread_id()}")
        while True:
            try:
                for code in target_codes_add_time:
log_module/async_log_util.py
@@ -4,7 +4,7 @@
import queue
import time
from log_module.log import logger_debug
from log_module.log import logger_debug, logger_system
from utils import tool
@@ -31,6 +31,7 @@
    # 运行同步日志
    def run_sync(self):
        logger_system.info(f"run_sync 线程ID:{tool.get_thread_id()}")
        while True:
            try:
                val = self.__log_queue.get()
@@ -77,6 +78,7 @@
# 运行同步日志
def run_sync():
    logger_system.info(f"async_log 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            val = log_queue.get()
outside_api_command_manager.py
@@ -11,8 +11,8 @@
# 心跳信息
from huaxin_client import socket_util
from huaxin_client.client_network import SendResponseSkManager
from log_module.log import logger_debug
from utils import middle_api_protocol
from log_module.log import logger_debug, logger_system
from utils import middle_api_protocol, tool
MSG_TYPE_HEART = "heart"
# 命令信息
@@ -244,6 +244,7 @@
    @classmethod
    def __maintain_client(cls):
        logger_system.info(f"outside_api __maintain_client 线程ID:{tool.get_thread_id()}")
        while True:
            try:
                if len(cls.trade_client_dict) < cls.trade_client_count:
trade/huaxin/huaxin_trade_api.py
@@ -9,16 +9,19 @@
from huaxin_client.trade_transform_protocol import TradeRequest
from log_module import async_log_util
from log_module.log import hx_logger_trade_debug, hx_logger_trade_loop, hx_logger_trade_callback, logger_trade
from log_module.log import hx_logger_trade_debug, hx_logger_trade_loop, hx_logger_trade_callback, logger_trade, \
    logger_system
from trade.huaxin import huaxin_trade_data_update
from trade.huaxin.huaxin_trade_record_manager import TradeOrderIdManager
from utils import socket_util, huaxin_util
from utils import socket_util, huaxin_util, tool
# 外部传入的交易队列
pipe_trade = None
def __run_recv_pipe_trade():
    logger_system.info(f"huaxin_trade_api __run_recv_pipe_trade 线程ID:{tool.get_thread_id()}")
    # 设置结果
    def __set_response(data_json):
        if 'request_id' not in data_json:
trade/huaxin/trade_server.py
@@ -435,6 +435,7 @@
def clear_invalid_client():
    logger_system.info(f"trade_server clear_invalid_client 线程ID:{tool.get_thread_id()}")
    while True:
        try:
            huaxin_trade_api.ClientSocketManager.del_invalid_clients()
@@ -445,6 +446,7 @@
def __recv_pipe_l1(pipe_l1):
    logger_system.info(f"trade_server __recv_pipe_l1 线程ID:{tool.get_thread_id()}")
    if pipe_l1 is not None:
        while True:
            try:
@@ -796,6 +798,7 @@
            order_status = data["orderStatus"]
            huaxin_trade_record_manager.DelegateRecordManager.add([data])
            if huaxin_util.is_deal(order_status):
                if int(str(data["direction"])) == huaxin_util.TORA_TSTP_D_Buy:
                l2_trade_util.forbidden_trade(data["securityID"],msg="已成交")
                # 成交,更新成交列表与资金列表
                huaxin_trade_data_update.add_deal_list()
trade/l2_trade_util.py
@@ -129,7 +129,7 @@
# 禁止代码交易
def forbidden_trade(code, msg=None):
    add_to_forbidden_trade_codes(code)
    async_log_util.warning(logger_trade, f"加入黑名单原因:{msg}")
    async_log_util.warning(logger_trade, f"{code}加入黑名单原因:{msg}")
    # l2_data_manager.remove_from_l2_fixed_codes(code)
    # l2_code_operate.L2CodeOperate.get_instance().remove_l2_listen(code, "禁止代码交易")