|
|
@@ -94,6 +94,7 @@ impl AbstractWsMode {
|
|
|
// let response_data = func(message);
|
|
|
if response_data.is_some() {
|
|
|
let mut data = response_data.unwrap();
|
|
|
+ data.time = chrono::Utc::now().timestamp_micros();
|
|
|
data.label = lable.clone();
|
|
|
let code = data.code.clone();
|
|
|
/*
|
|
|
@@ -107,20 +108,26 @@ impl AbstractWsMode {
|
|
|
match code.as_str() {
|
|
|
"200" => {
|
|
|
if data.label.contains("gate_usdt_swap") {
|
|
|
- if data.channel == "futures.order_book" && read_tx.is_empty() {
|
|
|
- read_tx.unbounded_send(data).unwrap();
|
|
|
+ if data.channel == "futures.order_book" {
|
|
|
+ if read_tx.is_empty() {
|
|
|
+ read_tx.unbounded_send(data).unwrap();
|
|
|
+ }
|
|
|
} else {
|
|
|
read_tx.unbounded_send(data).unwrap();
|
|
|
}
|
|
|
} else if data.label.contains("binance_usdt_swap") {
|
|
|
- if data.channel == "bookTicker" && read_tx.is_empty() {
|
|
|
- read_tx.unbounded_send(data).unwrap();
|
|
|
+ if data.channel == "bookTicker" {
|
|
|
+ if read_tx.is_empty() {
|
|
|
+ read_tx.unbounded_send(data).unwrap();
|
|
|
+ }
|
|
|
} else {
|
|
|
read_tx.unbounded_send(data).unwrap();
|
|
|
}
|
|
|
} else if data.label.contains("bybit_usdt_swap") {
|
|
|
- if data.channel == "orderbook" && read_tx.is_empty() {
|
|
|
- read_tx.unbounded_send(data).unwrap();
|
|
|
+ if data.channel == "orderbook" {
|
|
|
+ if read_tx.is_empty() {
|
|
|
+ read_tx.unbounded_send(data).unwrap();
|
|
|
+ }
|
|
|
} else {
|
|
|
read_tx.unbounded_send(data).unwrap();
|
|
|
}
|