mirror of
https://github.com/oneclickvirt/backtrace.git
synced 2026-11-24 23:39:41 +08:00
feat: refresh ASN prefixes with bounded Go loader
This commit is contained in:
1 parent
dd4fdcdaea
commit
a32a1067d3
11 files changed
+632
-42
No files matched your search
+3
-3
@@ -80,11 +80,11 @@ func getData(endpoint string) string {
|
||||
InitLogger()
|
||||
defer Logger.Sync()
|
||||
}
|
||||
|
||||
|
||||
// 先测试CDN可用性
|
||||
testUrl := "https://raw.githubusercontent.com/spiritLHLS/ecs/main/back/test"
|
||||
cdnUrl := checkCdn(testUrl)
|
||||
|
||||
|
||||
// 如果有可用的CDN,使用CDN获取数据
|
||||
if cdnUrl != "" {
|
||||
url := cdnUrl + endpoint
|
||||
@@ -106,7 +106,7 @@ func getData(endpoint string) string {
|
||||
Logger.Info(fmt.Sprintf("CDN request failed: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// CDN不可用,尝试直连
|
||||
if model.EnableLoger {
|
||||
Logger.Info(fmt.Sprintf("Trying direct connection: %s", endpoint))
|
||||
|
||||
Reference in new issue
Block a user