Administrator
2023-09-15 0a8a250a3ca5e0c7cd9e228a1d84bf08c667db8a
开启交易通道测试
3个文件已修改
12 ■■■■■ 已修改文件
huaxin_client/command_manager.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/trade_client.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/command_manager.py
@@ -131,6 +131,7 @@
                    if val:
                        val = json.loads(val)
                        _type = val["type"]
                        logger_local_huaxin_trade_debug.debug(f"获取到策略端信息:{val}")
                        cls.process_command_thread_pool.submit(lambda:  cls.process_command(_type, None, val))
                except Exception as e:
huaxin_client/trade_client.py
@@ -1040,7 +1040,7 @@
            else:
                send_response(
                    json.dumps({"type": "response", "data": {"code": 0, "data": data}, "client_id": client_id,
                                "request_id": request_id}), type, client_id, request_id, temp_params[2])
                                "request_id": request_id}), type, client_id, request_id)
            async_log_util.info(logger_local_huaxin_trade_debug, "API回调结束 req_id-{} request_id-{}", req_id, request_id)
        else:
trade/huaxin/trade_server.py
@@ -739,6 +739,15 @@
                fdata["redis_async_task_count"] = redis_manager.RedisUtils.get_async_task_count()
            except:
                pass
            # 获取交易通道
            try:
                can_access = huaxin_trade_api.test_trade_channel()
                fdata["trade_channel_access"] = 1 if can_access else 0
            except Exception as e:
                logger_debug.exception(e)
                fdata["trade_channel_access"] = 0
            # 获取CPU与内存适用情况
            memory_info = psutil.virtual_memory()
            cpu_percent = psutil.cpu_percent(interval=1)