Jelajahi Sumber

v3.2.3: 新增清理次数上限,防止rust卡死。

skyffire 1 tahun lalu
induk
melakukan
79aee7ce7c
2 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 1 1
      Cargo.toml
  2. 6 0
      strategy/src/core.rs

+ 1 - 1
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "as-rust"
-version = "3.2.2"
+version = "3.2.3"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

+ 6 - 0
strategy/src/core.rs

@@ -1576,6 +1576,12 @@ impl Core {
         while !self.check_position(target_hold_coin).await {
             sleep(Duration::from_secs(1)).await;
 
+            if clear_count >= 20 {
+                info!("清理次数达到上限:{}次,不再执行清理。", clear_count);
+                info!("");
+                break
+            }
+
             clear_count += 1;
             info!("清理指令发送完毕,启动第{}次检查。", clear_count);
             info!("");