chore: code style (#44)
* some code refactor * service * chore: code style --------- Co-authored-by: naiba <[email protected]>
This commit is contained in:
+4
-1
@@ -38,6 +38,7 @@ import (
|
||||
pb "github.com/nezhahq/agent/proto"
|
||||
)
|
||||
|
||||
// Agent 运行时参数。如需添加新参数,记得同时在 service.go 中添加
|
||||
type AgentCliParam struct {
|
||||
SkipConnectionCount bool // 跳过连接数检查
|
||||
SkipProcsCount bool // 跳过进程数量检查
|
||||
@@ -432,7 +433,9 @@ func reportState() {
|
||||
|
||||
// doSelfUpdate 执行更新检查 如果更新成功则会结束进程
|
||||
func doSelfUpdate(useLocalVersion bool) {
|
||||
<-monitor.Sync
|
||||
if monitor.CachedCountry == "" {
|
||||
return
|
||||
}
|
||||
v := semver.MustParse("0.1.0")
|
||||
if useLocalVersion {
|
||||
v = semver.MustParse(version)
|
||||
|
||||
@@ -86,6 +86,7 @@ func serviceActions(cmd *cobra.Command, args []string) {
|
||||
{agentCliParam.DisableForceUpdate, "--disable-force-update", ""},
|
||||
{agentCliParam.UseIPv6CountryCode, "--use-ipv6-countrycode", ""},
|
||||
{agentConfig.GPU, "--gpu", ""},
|
||||
{agentCliParam.UseGiteeToUpgrade, "--gitee", ""},
|
||||
{agentCliParam.IPReportPeriod != 30*60, "-u", fmt.Sprint(agentCliParam.IPReportPeriod)},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user