Skip to content

Commit

Permalink
⚡️ 修改更新规则
Browse files Browse the repository at this point in the history
  • Loading branch information
kanrichan committed Apr 8, 2021
1 parent 3bcfac4 commit cbc886d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/xianqu/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func update(version, path string) {
)
if ret == 6 {
ApiOutPutLog("[I][更新] 正在选择最快的镜像源......")
fast := fastSite("gh.xcw.best", "hub.fastgit.org", "github.michikawachin.art", "github.com")
fast := fastSite("gh.xcw.best", "hub.fastgit.org", "github.michikawachin.art")
link = strings.ReplaceAll(link, "github.com", fast)
ApiOutPutLog(fmt.Sprintf("[I][更新] 开始下载: %s", link))
err := downLastRelease(link, path)
Expand Down Expand Up @@ -122,7 +122,7 @@ func install(path string) (err error) {
}

func ping(dst string) (ret string, err error) {
cmd := exec.Command("ping", "-n", "1", dst)
cmd := exec.Command("ping", "-n", "3", dst)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
out, err := cmd.CombinedOutput()
if err != nil {
Expand Down Expand Up @@ -150,6 +150,6 @@ func fastSite(sites ...string) string {
case site := <-back:
return site
case <-time.After(time.Second * 10):
return sites[0]
return "github.com"
}
}

0 comments on commit cbc886d

Please sign in to comment.