From dfb7d4ebdfed6bf91d570d2bdff5bcfabf1e7aa5 Mon Sep 17 00:00:00 2001 From: Snowflake Date: Sun, 7 Jun 2026 13:10:15 +0800 Subject: [PATCH] fixed rebooting circulation --- main.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.rb b/main.rb index 6f91729..c7fb7fb 100644 --- a/main.rb +++ b/main.rb @@ -33,6 +33,11 @@ def main elsif operation == "ForceResetServerProcess" MethodExecutor.record("info", "mainloop", "Action: ForceResetServerProcess triggered.") MethodExecutor.reset_minecraft_server + # 重启后等待服务器启动(MC服务器启动通常需要30秒~2分钟) + cooldown = 240 # 240秒冷却期 + MethodExecutor.record("info", "mainloop", "Cooling down #{cooldown}s for server startup...") + sleep cooldown + MethodExecutor.record("info", "mainloop", "Cooldown finished, resuming monitoring.") end end end