Fixed bugs.

This commit is contained in:
2026-06-08 13:28:49 +08:00
parent bac58cf3d5
commit c234b76e78
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ module ServerStatusDetector
class MinecraftServer < TcpServer
# rubocop:disable Metrics/MethodLength
# @return [Hash{Symbol=>Boolean, Symbol=>Array<String>, Symbol=>String}]
def self_diag
def self.self_diag
res = test_port('127.0.0.1', 25_565)
unless res[:error].nil?
+4 -3
View File
@@ -20,15 +20,15 @@ require 'uri'
# @type const RELEASE_SERIAL_CODE: String
RELEASE_SERIAL_CODE = 'b2baee0'
# @type const CHANNEL: String
CHANNEL = 'master'
CHANNEL = 'dev'
# @type const VERSION_LIST_URL: String
VERSION_LIST_URL = "https://raw.giteeusercontent.com/SCU_team/mine-sentinel/#{CHANNEL}/APP_VERSIONS_LIST"
VERSION_LIST_URL = "https://gitee.com/api/v5/repos/SCU_team/mine-sentinel/contents/APP_VERSIONS_LIST?ref=#{CHANNEL}"
# @type const RECURSIVE_RETRY_DEPTH: Integer
RECURSIVE_RETRY_DEPTH = 3
class UpdateManager
# rubocop:disable Metrics/MethodLength
# @return [String]
# @return [String, nil]
def self.fetch
MethodExecutor.record('debug', 'updates', "Fetching version list from #{VERSION_LIST_URL}")
uri = URI(VERSION_LIST_URL)
@@ -42,6 +42,7 @@ class UpdateManager
end
rescue StandardError => e
MethodExecutor.record('error', 'updates', "Failed to fetch version list: #{e}")
nil
end
# rubocop:enable Metrics/MethodLength