Explorar o código

防止卡通道读取。

skyfffire %!s(int64=2) %!d(string=hai) anos
pai
achega
639e280ae2
Modificáronse 3 ficheiros con 3 adicións e 2 borrados
  1. 1 1
      exchanges/src/kucoin_swap_ws.rs
  2. 1 1
      strategy/src/kucoin_swap.rs
  3. 1 0
      strategy/src/quant.rs

+ 1 - 1
exchanges/src/kucoin_swap_ws.rs

@@ -322,7 +322,7 @@ impl KucoinSwapWs {
         let mut ping_interval = chrono::Utc::now().timestamp_millis();
         let mut ping_timeout = chrono::Utc::now().timestamp_millis();
         loop {
-            tokio::time::sleep(Duration::from_millis(1)).await;
+            tokio::time::sleep(Duration::from_nanos(1)).await;
             let msg = web_socket.read_message();
             match msg {
                 Ok(Message::Text(text)) => {

+ 1 - 1
strategy/src/kucoin_swap.rs

@@ -71,7 +71,7 @@ pub async fn kucoin_swap_run(bool_v1 :Arc<AtomicBool>, type_num: i8, quant_arc:
         let mut min_sell = Decimal::ZERO;
         let multiplier = bot_arc_clone.lock().await.platform_rest.get_self_market().ct_val;
         loop {
-            sleep(Duration::from_millis(1)).await;
+            sleep(Duration::from_nanos(1)).await;
 
             match rx.recv().await {
                 Some(data) => {

+ 1 - 0
strategy/src/quant.rs

@@ -578,6 +578,7 @@ impl Quant {
     }
 
     pub fn _update_depth(&mut self, depth: Vec<Decimal>, name: String, mut trace_stack: TraceStack) {
+        // info!(?depth, ?name);
         trace_stack.on_depth();
 
         // 要从回调传入的深度信息中获取data.name