From b43527c52ee29a287505e86a7e70df44d63832f8 Mon Sep 17 00:00:00 2001 From: Snowflake Date: Mon, 8 Jun 2026 10:37:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8F=90=E5=8F=96=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=97=B4=E9=9A=94=E4=B8=BA=20CHECK=5FINTERVAL=20?= =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEPLOY.md | 2 +- OfficialWebsite/index.html | 2 +- config.rb | 3 ++- main.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DEPLOY.md b/DEPLOY.md index fc4a419..5a52c07 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -137,7 +137,7 @@ MineSentinel 启动: | 初始宽限期 | `config.rb` | 1 | `300` s | | 冷却期 | `config.rb` | 3 | `200` s | | 尝试次数 | `config.rb` | 2 | `3` 次 | -| 检测间隔 | `main.rb` | 90 | `1.5` s | +| 检测间隔 | `config.rb` | 4 | `1.5` s | | systemctl 超时 | `method_executor.rb` | 17 | `30` s | | 最大重试 | `method_executor.rb` | 23 | `10` 次 | | 检测端口 | `server_status_detector.rb` | 60 | `25565` | diff --git a/OfficialWebsite/index.html b/OfficialWebsite/index.html index c44240e..ae8dbc7 100644 --- a/OfficialWebsite/index.html +++ b/OfficialWebsite/index.html @@ -591,7 +591,7 @@ journalctl -u minesentinel -u minecraft -f # 双服务合并 初始宽限期config.rb1300 s 冷却期config.rb3200 s 尝试次数config.rb23 次 - 检测间隔main.rb901.5 s + 检测间隔config.rb41.5 s systemctl 超时method_executor.rb1730 s 最大重试method_executor.rb2310 次 检测端口server_status_detector.rb6025565 diff --git a/config.rb b/config.rb index 113bf46..4cdad89 100644 --- a/config.rb +++ b/config.rb @@ -1,3 +1,4 @@ INITIAL_GRACE = 300 # 初次启动等待 300 秒 TRY_TIMES = 3 # 尝试次数 -RST_COOLDOWN_DURATION = 200 # 重启冷却期 200 秒 \ No newline at end of file +RST_COOLDOWN_DURATION = 200 # 重启冷却期 200 秒 +CHECK_INTERVAL = 1.5 # 检测间隔 1.5 秒 \ No newline at end of file diff --git a/main.rb b/main.rb index c0e1633..57f4565 100644 --- a/main.rb +++ b/main.rb @@ -87,7 +87,7 @@ end def main_loop while true - sleep 1.5 + sleep CHECK_INTERVAL SystemdNotifier.notify("WATCHDOG=1") main_once end