Fix: failed to initialize update checker http client

pull/1040/head
HFO4 4 years ago
parent adaa3290dd
commit 24b5313ccf

@ -1 +1 @@
Subproject commit 59890e6b22d69befa8b742a64967b6bab1bb4a3d Subproject commit fe6297c952319762a8f27f6a8c121b513d3859c0

@ -34,7 +34,7 @@ type GitHubRelease struct {
// CheckUpdate 检查更新 // CheckUpdate 检查更新
func CheckUpdate() { func CheckUpdate() {
client := request.HTTPClient{} client := request.NewClient()
res, err := client.Request("GET", "https://api.github.com/repos/cloudreve/cloudreve/releases", nil).GetResponse() res, err := client.Request("GET", "https://api.github.com/repos/cloudreve/cloudreve/releases", nil).GetResponse()
if err != nil { if err != nil {
util.Log().Warning("更新检查失败, %s", err) util.Log().Warning("更新检查失败, %s", err)

@ -51,7 +51,6 @@ func NewMonitor(task *model.Download) {
// Loop 开启监控循环 // Loop 开启监控循环
func (monitor *Monitor) Loop() { func (monitor *Monitor) Loop() {
defer mq.GlobalMQ.Unsubscribe(monitor.Task.GID, monitor.notifier) defer mq.GlobalMQ.Unsubscribe(monitor.Task.GID, monitor.notifier)
fmt.Println(cluster.Default)
// 首次循环立即更新 // 首次循环立即更新
interval := time.Duration(0) interval := time.Duration(0)

Loading…
Cancel
Save