This commit is contained in:
naiba 2021-11-04 13:52:45 +08:00
parent 4b36223b4b
commit b25c336dd4

View File

@ -116,7 +116,7 @@ func run() {
time.Sleep(time.Minute * 20) time.Sleep(time.Minute * 20)
updateCh <- struct{}{} updateCh <- struct{}{}
}() }()
doSelfUpdate(false) doSelfUpdate(true)
}() }()
} }
}() }()
@ -238,9 +238,9 @@ func reportState() {
} }
} }
func doSelfUpdate(donNotUseLocalVersion bool) { func doSelfUpdate(useLocalVersion bool) {
v := semver.MustParse("0.1.0") v := semver.MustParse("0.1.0")
if !donNotUseLocalVersion { if useLocalVersion {
v = semver.MustParse(version) v = semver.MustParse(version)
} }
println("检查更新:", v) println("检查更新:", v)
@ -258,7 +258,7 @@ func handleUpgradeTask(task *pb.Task, result *pb.TaskResult) {
if agentConf.DisableForceUpdate { if agentConf.DisableForceUpdate {
return return
} }
doSelfUpdate(true) doSelfUpdate(false)
} }
func handleTcpPingTask(task *pb.Task, result *pb.TaskResult) { func handleTcpPingTask(task *pb.Task, result *pb.TaskResult) {