mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
update: 发送消息前对服务器状态进行拷贝 保证消息发送的状态指标与触发该请求的状态指标相同
This commit is contained in:
@@ -3,6 +3,7 @@ package singleton
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/jinzhu/copier"
|
||||
"sync"
|
||||
|
||||
"github.com/robfig/cron/v3"
|
||||
@@ -84,7 +85,10 @@ func CronTrigger(cr model.Cron) func() {
|
||||
Type: model.TaskTypeCommand,
|
||||
})
|
||||
} else {
|
||||
SendNotification(cr.NotificationTag, fmt.Sprintf("$%d$[任务失败] %s,服务器 %s 离线,无法执行。", s.ID, cr.Name, s.Name), false)
|
||||
// 保存当前服务器状态信息
|
||||
curServer := model.Server{}
|
||||
copier.Copy(&curServer, s)
|
||||
SendNotification(cr.NotificationTag, fmt.Sprintf("[任务失败] %s,服务器 %s 离线,无法执行。", cr.Name, s.Name), false, &curServer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user