From b25c336dd4e91badf5b3d05b35b295605bb4cef9 Mon Sep 17 00:00:00 2001 From: naiba Date: Thu, 4 Nov 2021 13:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/agent/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 763e920520..71510c5af3 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -116,7 +116,7 @@ func run() { time.Sleep(time.Minute * 20) 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") - if !donNotUseLocalVersion { + if useLocalVersion { v = semver.MustParse(version) } println("检查更新:", v) @@ -258,7 +258,7 @@ func handleUpgradeTask(task *pb.Task, result *pb.TaskResult) { if agentConf.DisableForceUpdate { return } - doSelfUpdate(true) + doSelfUpdate(false) } func handleTcpPingTask(task *pb.Task, result *pb.TaskResult) {