Fixed bugs.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user