Răsfoiți Sursa

coinex 异常不remove,解决警告

JiahengHe 1 an în urmă
părinte
comite
edf66989ba
2 a modificat fișierele cu 6 adăugiri și 15 ștergeri
  1. 1 1
      exchanges/src/socket_tool.rs
  2. 5 14
      standard/src/coinex_swap.rs

+ 1 - 1
exchanges/src/socket_tool.rs

@@ -235,7 +235,7 @@ impl AbstractWsMode {
                     }
                 }
             ) {
-                Ok(o) => {
+                Ok(_o) => {
                     trace!("发送指令-心跳:{:?}",h_type);
                 }
                 Err(k) => {

+ 5 - 14
standard/src/coinex_swap.rs

@@ -10,7 +10,7 @@ use rust_decimal::prelude::{FromPrimitive, ToPrimitive};
 use serde_json::{Value};
 use tokio::spawn;
 use tokio::time::Instant;
-use tracing::{error, info, trace, warn};
+use tracing::{error, info, trace};
 use exchanges::coinex_swap_rest::CoinexSwapRest;
 use crate::{Platform, ExchangeEnum, Account, Position, Ticker, Market, Order, OrderCommand, PositionModeEnum, utils};
 use global::trace_stack::TraceStack;
@@ -358,7 +358,7 @@ impl Platform for CoinexSwap {
                         amount: Default::default(),
                         deal_amount: Default::default(),
                         avg_price: Default::default(),
-                        status: "REMOVE".to_string(),
+                        status: "NULL".to_string(),
                         order_type: "".to_string(),
                         trace_stack: TraceStack::new(0, Instant::now()).on_special("358 coinex_swap".to_string()),
                     })
@@ -508,7 +508,7 @@ impl Platform for CoinexSwap {
                     amount: Default::default(),
                     deal_amount: Default::default(),
                     avg_price: Default::default(),
-                    status: "REMOVE".to_string(),
+                    status: "NULL".to_string(),
                     order_type: "".to_string(),
                     trace_stack:  TraceStack::new(0, Instant::now()).on_special("485 coinex_swap".to_string())
                 };
@@ -655,17 +655,8 @@ impl Platform for CoinexSwap {
                                 // info!("查单 订单详情:{:?}", order);
                                 self_clone.order_sender.send(order).await.unwrap();
                             }
-                            Err(err) => {
-                                // 未成交已取消的订单会报不存在
-                                if err.to_string().contains("3103:order not exists") {
-                                    let mut order = Order::new();
-                                    order.id = order_id.to_string();
-                                    order.custom_id = custom_id.to_string();
-                                    order.status = "REMOVE".to_string();
-                                    self_clone.order_sender.send(order).await.unwrap();
-                                } else {
-                                    warn!("撤单失败,而且查单也失败了,Coinex_io_swap,oid={}, cid={} err={:?}", order_id.clone(), custom_id.clone(), err);
-                                }
+                            Err(_err) => {
+                                // warn!("撤单失败,而且查单也失败了,Coinex_io_swap,oid={}, cid={} err={:?}", order_id.clone(), custom_id.clone(), err);
                                 // panic!("撤单失败,而且查单也失败了,Coinex_io_swap,oid={}, cid={}。", order_id.clone(), custom_id.clone());
                             }
                         }