|
@@ -604,28 +604,32 @@ impl Platform for CoinexSwap {
|
|
|
let handle = spawn(async move {
|
|
let handle = spawn(async move {
|
|
|
// info!("数量 {},方向 {},价格 {},c_id {}", amount, side, price, cid);
|
|
// info!("数量 {},方向 {},价格 {},c_id {}", amount, side, price, cid);
|
|
|
ts.on_before_send();
|
|
ts.on_before_send();
|
|
|
- let result = self_clone.take_order(&cid, &side, price, amount).await;
|
|
|
|
|
|
|
+ let mut result = self_clone.take_order(&cid, &side, price, amount).await.unwrap();
|
|
|
ts.on_after_send();
|
|
ts.on_after_send();
|
|
|
|
|
|
|
|
- match result {
|
|
|
|
|
- Ok(mut result) => {
|
|
|
|
|
- result.trace_stack = ts;
|
|
|
|
|
- // info!("数量 {},方向 {},价格 {},c_id {}", amount, side, price, cid);
|
|
|
|
|
- self_clone.order_sender.send(result).await.unwrap();
|
|
|
|
|
- }
|
|
|
|
|
- Err(error) => {
|
|
|
|
|
- let mut err_order = Order::new();
|
|
|
|
|
- err_order.custom_id = cid.clone();
|
|
|
|
|
- err_order.status = "REMOVE".to_string();
|
|
|
|
|
- info!("coinex下单error 数量: {},方向: {},价格: {},c_id: {}, err: {}", amount, side, price, cid, error);
|
|
|
|
|
- self_clone.order_sender.send(err_order).await.unwrap();
|
|
|
|
|
- self_clone.error_sender.send(error).await.unwrap();
|
|
|
|
|
- // 触发限频
|
|
|
|
|
- // if error_info.to_string().contains("213:Please don't try too frequently") {
|
|
|
|
|
- // Err(Error::new(ErrorKind::Other, "触发限频, 请调整下单频率"))
|
|
|
|
|
- // }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ result.trace_stack = ts;
|
|
|
|
|
+ // info!("数量 {},方向 {},价格 {},c_id {}", amount, side, price, cid);
|
|
|
|
|
+ self_clone.order_sender.send(result).await.unwrap();
|
|
|
|
|
+
|
|
|
|
|
+ // match result {
|
|
|
|
|
+ // Ok(mut result) => {
|
|
|
|
|
+ // result.trace_stack = ts;
|
|
|
|
|
+ // // info!("数量 {},方向 {},价格 {},c_id {}", amount, side, price, cid);
|
|
|
|
|
+ // self_clone.order_sender.send(result).await.unwrap();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // Err(error) => {
|
|
|
|
|
+ // let mut err_order = Order::new();
|
|
|
|
|
+ // err_order.custom_id = cid.clone();
|
|
|
|
|
+ // err_order.status = "REMOVE".to_string();
|
|
|
|
|
+ // info!("coinex下单error 数量: {},方向: {},价格: {},c_id: {}, err: {}", amount, side, price, cid, error);
|
|
|
|
|
+ // self_clone.order_sender.send(err_order).await.unwrap();
|
|
|
|
|
+ // self_clone.error_sender.send(error).await.unwrap();
|
|
|
|
|
+ // // 触发限频
|
|
|
|
|
+ // // if error_info.to_string().contains("213:Please don't try too frequently") {
|
|
|
|
|
+ // // Err(Error::new(ErrorKind::Other, "触发限频, 请调整下单频率"))
|
|
|
|
|
+ // // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
});
|
|
});
|
|
|
handles.push(handle)
|
|
handles.push(handle)
|
|
|
}
|
|
}
|