fixed rebooting circulation
This commit is contained in:
@@ -33,6 +33,11 @@ def main
|
|||||||
elsif operation == "ForceResetServerProcess"
|
elsif operation == "ForceResetServerProcess"
|
||||||
MethodExecutor.record("info", "mainloop", "Action: ForceResetServerProcess triggered.")
|
MethodExecutor.record("info", "mainloop", "Action: ForceResetServerProcess triggered.")
|
||||||
MethodExecutor.reset_minecraft_server
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user