mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
🐛 fix: 取历史SSL采样导致频繁重启
This commit is contained in:
parent
76c129d1cd
commit
67df0852f9
@ -29,7 +29,7 @@ func (s *NezhaHandler) ReportTask(c context.Context, r *pb.TaskResult) (*pb.Rece
|
||||
errMsg = r.GetData()
|
||||
} else {
|
||||
var last model.MonitorHistory
|
||||
if err := dao.DB.Where("monitor_id = ? AND data NOT LIKE ?", r.GetId(), "SSL证书错误:%").Order("id DESC").First(&last).Error; err == nil {
|
||||
if err := dao.DB.Where("monitor_id = ? AND data LIKE ?", r.GetId(), "%|%").Order("id DESC").First(&last).Error; err == nil {
|
||||
var oldCert = strings.Split(last.Data, "|")
|
||||
var newCert = strings.Split(r.GetData(), "|")
|
||||
expiresOld, _ := time.Parse("2006-01-02 15:04:05 -0700 MST", oldCert[1])
|
||||
|
Loading…
Reference in New Issue
Block a user