Ver Fonte

注释定时检查仓位

JiahengHe há 1 ano atrás
pai
commit
5a42e66e0e
1 ficheiros alterados com 19 adições e 19 exclusões
  1. 19 19
      src/core_libs.rs

+ 19 - 19
src/core_libs.rs

@@ -125,25 +125,25 @@ pub async fn init(params: Params,
     });
 
     // 定时仓位检测
-    let markt_price_core_arc = core_arc.clone();
-    tokio::spawn(async move {
-        info!("rest仓位检测定时任务启动(5s)...");
-        loop {
-            tokio::time::sleep(Duration::from_secs(5)).await;
-
-            let mut core = markt_price_core_arc.lock().await;
-            match core.platform_rest.get_position().await {
-                Ok(pos) => {
-                    if pos.len() > 0 {
-                        core.update_position(pos).await;
-                    }
-                },
-                Err(err) => {
-                    error!("rest持仓数据获取异常 {}", err);
-                }
-            };
-        }
-    });
+    // let markt_price_core_arc = core_arc.clone();
+    // tokio::spawn(async move {
+    //     info!("rest仓位检测定时任务启动(5s)...");
+    //     loop {
+    //         tokio::time::sleep(Duration::from_secs(5)).await;
+    //
+    //         let mut core = markt_price_core_arc.lock().await;
+    //         match core.platform_rest.get_positions().await {
+    //             Ok(pos) => {
+    //                 if pos.len() > 0 {
+    //                     core.update_position(pos).await;
+    //                 }
+    //             },
+    //             Err(err) => {
+    //                 error!("rest持仓数据获取异常 {}", err);
+    //             }
+    //         };
+    //     }
+    // });
 
     return core_arc;
 }