Prechádzať zdrojové kódy

解封通道消息传递限制,取消一堆判断。

skyfffire 1 rok pred
rodič
commit
dadc86c917
1 zmenil súbory, kde vykonal 27 pridanie a 25 odobranie
  1. 27 25
      exchanges/src/socket_tool.rs

+ 27 - 25
exchanges/src/socket_tool.rs

@@ -100,33 +100,35 @@ impl AbstractWsMode {
                                     data_c.time = chrono::Utc::now().timestamp_micros();
                                     data_c.label = lable.clone();
 
-                                    if data_c.label.contains("gate_usdt_swap") {
-                                        if data_c.channel == "futures.order_book" {
-                                            if read_tx.len() == 0 {
-                                                read_tx.unbounded_send(data_c).unwrap();
-                                            }
-                                        } else {
+                                    // if data_c.label.contains("gate_usdt_swap") {
+                                    //     if data_c.channel == "futures.order_book" {
+                                    //         if read_tx.len() == 0 {
+                                    //             read_tx.unbounded_send(data_c).unwrap();
+                                    //         }
+                                    //     } else {
+                                    //         read_tx.unbounded_send(data_c).unwrap();
+                                    //     }
+                                    // } else if data_c.label.contains("binance_usdt_swap") {
+                                    //     if data_c.channel == "bookTicker" {
+                                    //         if read_tx.len() == 0 {
+                                    //             read_tx.unbounded_send(data_c).unwrap();
+                                    //         }
+                                    //     } else {
+                                    //         read_tx.unbounded_send(data_c).unwrap();
+                                    //     }
+                                    // } else if data_c.label.contains("bybit_usdt_swap") {
+                                    //     if data_c.channel == "orderbook" {
+                                    //         if read_tx.len() == 0 {
+                                    //             read_tx.unbounded_send(data_c).unwrap();
+                                    //         }
+                                    //     } else {
+                                    //         read_tx.unbounded_send(data_c).unwrap();
+                                    //     }
+                                    // } else {
+                                        if read_tx.len() == 0 {
                                             read_tx.unbounded_send(data_c).unwrap();
                                         }
-                                    } else if data_c.label.contains("binance_usdt_swap") {
-                                        if data_c.channel == "bookTicker" {
-                                            if read_tx.len() == 0 {
-                                                read_tx.unbounded_send(data_c).unwrap();
-                                            }
-                                        } else {
-                                            read_tx.unbounded_send(data_c).unwrap();
-                                        }
-                                    } else if data_c.label.contains("bybit_usdt_swap") {
-                                        if data_c.channel == "orderbook" {
-                                            if read_tx.len() == 0 {
-                                                read_tx.unbounded_send(data_c).unwrap();
-                                            }
-                                        } else {
-                                            read_tx.unbounded_send(data_c).unwrap();
-                                        }
-                                    } else {
-                                        read_tx.unbounded_send(data_c).unwrap();
-                                    }
+                                    // }
                                 }
 
                                 let code = data.code.clone();