Browse Source

优化,不使用协程。

skyfffire 1 year ago
parent
commit
290a68f454
3 changed files with 3 additions and 5 deletions
  1. 1 3
      exchanges/src/socket_tool.rs
  2. 1 1
      strategy/src/binance_usdt_swap.rs
  3. 1 1
      strategy/src/gate_swap.rs

+ 1 - 3
exchanges/src/socket_tool.rs

@@ -131,9 +131,7 @@ impl AbstractWsMode {
                                     // } else {
                                     //     if read_tx.len() == 0 {
                                     let r = read1.clone();
-                                    spawn(async move {
-                                        r.lock().await.unbounded_send(data_c).unwrap();
-                                    });
+                                    r.lock().await.unbounded_send(data_c).unwrap();
                                     // }
                                     // }
                                 }

+ 1 - 1
strategy/src/binance_usdt_swap.rs

@@ -63,7 +63,7 @@ async fn on_data(bot_arc_clone: Arc<Mutex<Quant>>,
     trace_stack.on_after_network(data.time);
     trace_stack.on_before_unlock_quant();
 
-    info!("{}", trace_stack.to_string());
+    info!("bian>{}", trace_stack.to_string());
 
     // if data.code != "200".to_string() {
     //     return;

+ 1 - 1
strategy/src/gate_swap.rs

@@ -104,7 +104,7 @@ async fn on_data(bot_arc_clone: Arc<Mutex<Quant>>,
     trace_stack.on_after_network(data.time);
     trace_stack.on_before_unlock_quant();
 
-    info!("{}", trace_stack.to_string());
+    info!("gate>{}", trace_stack.to_string());
 
     // if data.code != "200".to_string() {
     //     return;