This commit is contained in:
parent
c2a9618f27
commit
1bcad97ed2
@ -41,7 +41,7 @@ func offlineMonitoring() {
|
|||||||
isOnline := time.Since(p.LastHandshakeTime).Minutes() < 3
|
isOnline := time.Since(p.LastHandshakeTime).Minutes() < 3
|
||||||
|
|
||||||
// 未离线
|
// 未离线
|
||||||
if !isOnline {
|
if isOnline {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ func offlineMonitoring() {
|
|||||||
content += fmt.Sprintf("最后握手时间:%s\r\n", p.LastHandshakeTime.Format("2006-01-02 15:04:05"))
|
content += fmt.Sprintf("最后握手时间:%s\r\n", p.LastHandshakeTime.Format("2006-01-02 15:04:05"))
|
||||||
|
|
||||||
// 离线并且配置了邮箱,准备发送邮件
|
// 离线并且配置了邮箱,准备发送邮件
|
||||||
err = utils.Mail().SendMail(clientInfo.Email, fmt.Sprintf("客户端离线通知"), content, "")
|
err = utils.Mail().SendMail(clientInfo.Email, fmt.Sprintf("客户端[%s]离线通知", clientInfo.Name), content, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("发送离线通知邮件失败: %v", err.Error())
|
log.Errorf("发送离线通知邮件失败: %v", err.Error())
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user