|
@@ -1,7 +1,6 @@
|
|
|
use std::collections::{BTreeMap};
|
|
use std::collections::{BTreeMap};
|
|
|
use std::io::{Error, ErrorKind};
|
|
use std::io::{Error, ErrorKind};
|
|
|
use std::str::FromStr;
|
|
use std::str::FromStr;
|
|
|
-use std::time::Duration;
|
|
|
|
|
use tokio::sync::mpsc::Sender;
|
|
use tokio::sync::mpsc::Sender;
|
|
|
use async_trait::async_trait;
|
|
use async_trait::async_trait;
|
|
|
use futures::stream::FuturesUnordered;
|
|
use futures::stream::FuturesUnordered;
|
|
@@ -625,7 +624,6 @@ impl Platform for CoinexSwap {
|
|
|
self_clone.order_sender.send(result).await.unwrap();
|
|
self_clone.order_sender.send(result).await.unwrap();
|
|
|
}
|
|
}
|
|
|
Err(error) => {
|
|
Err(error) => {
|
|
|
- let error_info = error.to_string();
|
|
|
|
|
let mut err_order = Order::new();
|
|
let mut err_order = Order::new();
|
|
|
err_order.custom_id = cid.clone();
|
|
err_order.custom_id = cid.clone();
|
|
|
err_order.status = "REMOVE".to_string();
|
|
err_order.status = "REMOVE".to_string();
|
|
@@ -633,10 +631,9 @@ impl Platform for CoinexSwap {
|
|
|
self_clone.order_sender.send(err_order).await.unwrap();
|
|
self_clone.order_sender.send(err_order).await.unwrap();
|
|
|
self_clone.error_sender.send(error).await.unwrap();
|
|
self_clone.error_sender.send(error).await.unwrap();
|
|
|
// 触发限频
|
|
// 触发限频
|
|
|
- if error_info.to_string().contains("213:Please don't try too frequently") {
|
|
|
|
|
- error!("触发限频, 1s后再下单");
|
|
|
|
|
- tokio::time::sleep(Duration::from_secs(1)).await;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if error_info.to_string().contains("213:Please don't try too frequently") {
|
|
|
|
|
+ // Err(Error::new(ErrorKind::Other, "触发限频, 请调整下单频率"))
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|