From 12b9356c17611288e0d8d0023445bc61efa6e090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:46:59 +0800 Subject: [PATCH] ref: Optimize code (#9845) --- agent/app/model/alert.go | 4 ++-- agent/utils/version/version.go | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/agent/app/model/alert.go b/agent/app/model/alert.go index a697a602f..ac364f510 100644 --- a/agent/app/model/alert.go +++ b/agent/app/model/alert.go @@ -18,7 +18,7 @@ type AlertTask struct { Type string `gorm:"type:varchar(64);not null" json:"type"` Quota string `gorm:"type:varchar(64)" json:"quota"` QuotaType string `gorm:"type:varchar(64)" json:"quotaType"` - Method string `gorm:"type:varchar(64);not null;default:'sms" json:"method"` + Method string `gorm:"type:varchar(64);not null;default:'sms'" json:"method"` } type AlertLog struct { @@ -33,7 +33,7 @@ type AlertLog struct { Message string `gorm:"type:varchar(256);" json:"message"` RecordId uint `gorm:"type:integer;" json:"recordId"` LicenseId string `gorm:"type:varchar(256);not null;" json:"licenseId" ` - Method string `gorm:"type:varchar(64);not null;default:'sms" json:"method"` + Method string `gorm:"type:varchar(64);not null;default:'sms'" json:"method"` } type AlertConfig struct { diff --git a/agent/utils/version/version.go b/agent/utils/version/version.go index b0951771f..2da2f3721 100644 --- a/agent/utils/version/version.go +++ b/agent/utils/version/version.go @@ -130,10 +130,6 @@ func loadVersion(isLatest bool, currentVersion, mode string) string { return "" } num, _ := strconv.Atoi(versionPart[1]) - if num == 0 { - global.LOG.Errorf("current version is error format: %s", currentVersion) - return "" - } if num >= 10 { if version, ok := versionMap[currentVersion[0:5]]; ok { return checkVersion(version, currentVersion)