diff --git a/README.md b/README.md index f44e142..fb276b3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Minecraft 服务器守护进程 [![License](https://img.shields.io/badge/License-MulanPubL--2.0-orange.svg)](http://license.coscl.org.cn/MulanPubL-2.0) [![Ruby](https://img.shields.io/badge/Ruby-%3E%3D3.0-cc342d?logo=ruby)](https://www.ruby-lang.org) -[![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows-blue)](#跨场景适配指南) +[![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows-blue)](docs/DEPLOY.md#跨场景适配指南) ## 快速开始 diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index aaf8bba..d47aaff 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -136,10 +136,10 @@ MineSentinel 启动: | 参数 | 文件 | 行 | 默认值 | |------|------|-----|--------| -| 初始宽限期 | `config.rb` | 1 | `300` s | -| 冷却期 | `config.rb` | 3 | `200` s | -| 尝试次数 | `config.rb` | 2 | `3` 次 | -| 检测间隔 | `config.rb` | 4 | `1.5` s | +| 初始宽限期 | `config.rb` | 18 | `300` s | +| 冷却期 | `config.rb` | 22 | `200` s | +| 尝试次数 | `config.rb` | 20 | `3` 次 | +| 检测间隔 | `config.rb` | 24 | `1.5` s | | systemctl 超时 | `method_executor.rb` | 17 | `30` s | | 最大重试 | `method_executor.rb` | 23 | `10` 次 | | 检测端口 | `server_status_detector.rb` | 60 | `25565` | @@ -204,8 +204,8 @@ pid = spawn "cmd /c start /B java -Xmx4G -jar C:\\mc\\server.jar nogui" ```ruby # server_status_detector.rb 第 60 行 -res = test_port('192.168.1.100', 3306) # MySQL -res = test_port('127.0.0.1', 80) # Nginx +res = ServerStatusDetector::TcpServer.test_port('192.168.1.100', 3306) # MySQL +res = ServerStatusDetector::TcpServer.test_port('127.0.0.1', 80) # Nginx ``` 配合修改 `method_executor.rb` 中的重启命令即可适配。 diff --git a/src/main.rb b/src/main.rb index 0960b45..2b6aefc 100644 --- a/src/main.rb +++ b/src/main.rb @@ -44,7 +44,7 @@ def main begin upd_result = UpdateManager.check - if upd_result[:status] == :NewerAvailable + if upd_result[:type] == :NewerAvailable MethodExecutor.record('info', 'updates', "Update #{upd_result[:version]} available, please check the git repo for details.") end diff --git a/src/systemd_notifier.rb b/src/systemd_notifier.rb index c027e68..fbf663d 100644 --- a/src/systemd_notifier.rb +++ b/src/systemd_notifier.rb @@ -38,7 +38,7 @@ class SystemdNotifier end # @return [Boolean] - def enabled? + def self.enabled? @enable_heartbeat end