Skip to content

Commit 12b9356

Browse files
authored
ref: Optimize code (1Panel-dev#9845)
1 parent d3a3429 commit 12b9356

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

agent/app/model/alert.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type AlertTask struct {
1818
Type string `gorm:"type:varchar(64);not null" json:"type"`
1919
Quota string `gorm:"type:varchar(64)" json:"quota"`
2020
QuotaType string `gorm:"type:varchar(64)" json:"quotaType"`
21-
Method string `gorm:"type:varchar(64);not null;default:'sms" json:"method"`
21+
Method string `gorm:"type:varchar(64);not null;default:'sms'" json:"method"`
2222
}
2323

2424
type AlertLog struct {
@@ -33,7 +33,7 @@ type AlertLog struct {
3333
Message string `gorm:"type:varchar(256);" json:"message"`
3434
RecordId uint `gorm:"type:integer;" json:"recordId"`
3535
LicenseId string `gorm:"type:varchar(256);not null;" json:"licenseId" `
36-
Method string `gorm:"type:varchar(64);not null;default:'sms" json:"method"`
36+
Method string `gorm:"type:varchar(64);not null;default:'sms'" json:"method"`
3737
}
3838

3939
type AlertConfig struct {

agent/utils/version/version.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ func loadVersion(isLatest bool, currentVersion, mode string) string {
130130
return ""
131131
}
132132
num, _ := strconv.Atoi(versionPart[1])
133-
if num == 0 {
134-
global.LOG.Errorf("current version is error format: %s", currentVersion)
135-
return ""
136-
}
137133
if num >= 10 {
138134
if version, ok := versionMap[currentVersion[0:5]]; ok {
139135
return checkVersion(version, currentVersion)

0 commit comments

Comments
 (0)