Fixed bugs.
This commit is contained in:
@@ -61,7 +61,7 @@ module ServerStatusDetector
|
|||||||
class MinecraftServer < TcpServer
|
class MinecraftServer < TcpServer
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
# @return [Hash{Symbol=>Boolean, Symbol=>Array<String>, Symbol=>String}]
|
# @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)
|
res = test_port('127.0.0.1', 25_565)
|
||||||
|
|
||||||
unless res[:error].nil?
|
unless res[:error].nil?
|
||||||
|
|||||||
+4
-3
@@ -20,15 +20,15 @@ require 'uri'
|
|||||||
# @type const RELEASE_SERIAL_CODE: String
|
# @type const RELEASE_SERIAL_CODE: String
|
||||||
RELEASE_SERIAL_CODE = 'b2baee0'
|
RELEASE_SERIAL_CODE = 'b2baee0'
|
||||||
# @type const CHANNEL: String
|
# @type const CHANNEL: String
|
||||||
CHANNEL = 'master'
|
CHANNEL = 'dev'
|
||||||
# @type const VERSION_LIST_URL: String
|
# @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
|
# @type const RECURSIVE_RETRY_DEPTH: Integer
|
||||||
RECURSIVE_RETRY_DEPTH = 3
|
RECURSIVE_RETRY_DEPTH = 3
|
||||||
|
|
||||||
class UpdateManager
|
class UpdateManager
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
# @return [String]
|
# @return [String, nil]
|
||||||
def self.fetch
|
def self.fetch
|
||||||
MethodExecutor.record('debug', 'updates', "Fetching version list from #{VERSION_LIST_URL}")
|
MethodExecutor.record('debug', 'updates', "Fetching version list from #{VERSION_LIST_URL}")
|
||||||
uri = URI(VERSION_LIST_URL)
|
uri = URI(VERSION_LIST_URL)
|
||||||
@@ -42,6 +42,7 @@ class UpdateManager
|
|||||||
end
|
end
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
MethodExecutor.record('error', 'updates', "Failed to fetch version list: #{e}")
|
MethodExecutor.record('error', 'updates', "Failed to fetch version list: #{e}")
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/MethodLength
|
# rubocop:enable Metrics/MethodLength
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user