| | |
| | | try: |
| | | if type_ == "delegate_list": |
| | | dataJSON = huaxin_trade_api.get_delegate_list(can_cancel=False, timeout=10) |
| | | print("获取到的委托:", dataJSON) |
| | | if dataJSON["code"] == 0: |
| | | data = dataJSON["data"] |
| | | huaxin_trade_record_manager.DelegateRecordManager.add(data) |
| | |
| | | __process_thread_pool.submit(huaxin_trade_record_manager.PositionManager.add, datas) |
| | | async_log_util.info(hx_logger_trade_debug, f"获取交易数据成功:{type_}") |
| | | except Exception as e1: |
| | | print("出错:", str(e1)) |
| | | logging.exception(e1) |
| | | # if str(e1).find("超时") >= 0: |
| | | # # 读取结果超时需要重新请求 |
| | | # trade_data_request_queue.put_nowait({"type": type_}) |
| | |
| | | |
| | | @classmethod |
| | | def add(cls, datas): |
| | | print("保存委托数据:", datas) |
| | | mysqldb = mysql_data.Mysqldb() |
| | | try: |
| | | if datas: |