소스 검색

高速通道注释 优化

875428575@qq.com 2 년 전
부모
커밋
bf8b0a8174

+ 6 - 5
exchanges/src/binance_spot_ws.rs

@@ -63,11 +63,7 @@ impl BinanceSpotWs {
                      sender: Sender<ResponseData>,
     ) -> BinanceSpotWs
     {
-        if is_colo {
-            info!("开启高速(未配置,走普通)通道");
-        }else{
-            info!("走普通通道");
-        }
+
 
         /*******走代理:根据环境变量配置来决定,如果配置了走代理,没有配置不走*******/
         let parsing_detail = proxy::ParsingDetail::parsing_environment_variables();
@@ -79,6 +75,11 @@ impl BinanceSpotWs {
             }
         };
 
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",request_url);
+        }else{
+            info!("走普通通道:{}",request_url);
+        }
         /*****返回结构体*******/
         BinanceSpotWs {
             label,

+ 5 - 2
exchanges/src/binance_swap_rest.rs

@@ -35,13 +35,16 @@ impl BinanceSwapRest {
     pub fn new_label(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> BinanceSwapRest
     {
         let base_url = if is_colo {
-            info!("开启高速(未配置,走普通)通道");
             "https://fapi.binance.com".to_string()
         } else {
-            info!("走普通通道");
             "https://fapi.binance.com".to_string()
         };
 
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",base_url);
+        } else {
+            info!("走普通通道:{}",base_url);
+        }
         /*****返回结构体*******/
         BinanceSwapRest {
             label,

+ 5 - 8
exchanges/src/binance_swap_ws.rs

@@ -62,13 +62,6 @@ impl BinanceSwapWs {
                      sender: Sender<ResponseData>,
     ) -> BinanceSwapWs
     {
-        if is_colo {
-            info!("开启高速(未配置,走普通)通道");
-        }else{
-            info!("走普通通道");
-        }
-
-
         /*******走代理:根据环境变量配置来决定,如果配置了走代理,没有配置不走*******/
         let parsing_detail = proxy::ParsingDetail::parsing_environment_variables();
 
@@ -79,7 +72,11 @@ impl BinanceSwapWs {
             }
         };
 
-        trace!("当前地址:{}",request_url);
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",request_url);
+        } else {
+            info!("走普通通道:{}",request_url);
+        }
         /*****返回结构体*******/
         BinanceSwapWs {
             label,

+ 5 - 2
exchanges/src/gate_swap_rest.rs

@@ -37,14 +37,17 @@ impl GateSwapRest {
     pub fn new_label(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> GateSwapRest
     {
         let base_url = if is_colo {
-            info!("开启高速(未配置,走普通)通道");
             // "https://apiv4-private.gateapi.io".to_string()
             "https://api.gateio.ws".to_string()
         } else {
-            info!("走普通通道");
             "https://api.gateio.ws".to_string()
         };
 
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",base_url);
+        } else {
+            info!("走普通通道:{}",base_url);
+        }
         /*****返回结构体*******/
         GateSwapRest {
             label,

+ 5 - 6
exchanges/src/gate_swap_ws.rs

@@ -70,11 +70,6 @@ impl GateSwapWs {
                      sender: Sender<ResponseData>,
     ) -> GateSwapWs
     {
-        if is_colo {
-            info!("开启高速(未配置,走普通)通道");
-        }else{
-            info!("走普通通道");
-        }
 
         /*******走代理:根据环境变量配置来决定,如果配置了走代理,没有配置不走*******/
         let parsing_detail = proxy::ParsingDetail::parsing_environment_variables();
@@ -86,7 +81,11 @@ impl GateSwapWs {
             }
         };
 
-        trace!("当前地址:{}",request_url);
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",request_url);
+        } else {
+            info!("走普通通道:{}",request_url);
+        }
         /*****返回结构体*******/
         GateSwapWs {
             label,

+ 5 - 3
exchanges/src/kucoin_swap_rest.rs

@@ -36,14 +36,16 @@ impl KucoinSwapRest {
     }
     pub fn new_lable(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> KucoinSwapRest {
         let base_url = if is_colo {
-            info!("开启高速(未配置,走普通)通道");
             "https://api-futures.kucoin.com".to_string()
         } else {
-            info!("走普通通道");
             "https://api-futures.kucoin.com".to_string()
         };
 
-
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",base_url);
+        } else {
+            info!("走普通通道:{}",base_url);
+        }
         /*****返回结构体*******/
         KucoinSwapRest {
             label,

+ 3 - 8
exchanges/src/kucoin_swap_ws.rs

@@ -71,18 +71,12 @@ impl KucoinSwapWs {
     ) -> KucoinSwapWs {
         return KucoinSwapWs::new_label("default-KucoinSwapWs".to_string(), is_colo, login_param, ws_type, sender).await;
     }
-    pub async fn new_label(label: String, is_colo: bool,
+    pub async fn new_label(label: String, _is_colo: bool,
                            login_param: BTreeMap<String, String>,
                            ws_type: KucoinWsType,
                            sender: Sender<ResponseData>,
     ) -> KucoinSwapWs
     {
-        if is_colo {
-            info!("开启高速(未配置,走普通)通道");
-        }else{
-            info!("走普通通道");
-        }
-
         /*******走代理:根据环境变量配置来决定,如果配置了走代理,没有配置不走*******/
         let parsing_detail = proxy::ParsingDetail::parsing_environment_variables();
 
@@ -103,6 +97,7 @@ impl KucoinSwapWs {
             }
         }
 
+
         /*****返回结构体*******/
         KucoinSwapWs {
             label,
@@ -175,7 +170,7 @@ impl KucoinSwapWs {
     {
         self.symbol_s = b_array.clone();
         self.request_url = format!("{}?token={}", self.ws_param.ws_url, self.ws_param.token);
-        trace!("当前地址:{}",self.request_url);
+        info!("走普通通道:{}",  self.request_url);
         self.run(bool_v1).await;
     }
 

+ 5 - 3
exchanges/src/okx_swap_rest.rs

@@ -35,14 +35,16 @@ impl OkxSwapRest {
     }
     pub fn new_lable(label: String, is_colo: bool, login_param: BTreeMap<String, String>) -> OkxSwapRest {
         let base_url = if is_colo {
-            info!("开启高速(未配置,走普通)通道");
             "https://www.okx.com".to_string()
         } else {
-            info!("走普通通道");
             "https://www.okx.com".to_string()
         };
 
-
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",base_url);
+        } else {
+            info!("走普通通道:{}",base_url);
+        }
         /*****返回结构体*******/
         OkxSwapRest {
             label,

+ 5 - 7
exchanges/src/okx_swap_ws.rs

@@ -76,12 +76,6 @@ impl OkxSwapWs {
                      sender: Sender<ResponseData>,
     ) -> OkxSwapWs
     {
-        if is_colo {
-            info!("开启高速(未配置,走普通)通道");
-        }else{
-            info!("走普通通道");
-        }
-
         /*******走代理:根据环境变量配置来决定,如果配置了走代理,没有配置不走*******/
         let parsing_detail = proxy::ParsingDetail::parsing_environment_variables();
 
@@ -98,7 +92,11 @@ impl OkxSwapWs {
             }
         };
 
-        trace!("当前地址:{}",request_url);
+        if is_colo {
+            info!("开启高速(未配置,走普通:{})通道",request_url);
+        } else {
+            info!("走普通通道:{}",request_url);
+        }
         /*****返回结构体*******/
         OkxSwapWs {
             label,