small improvements (#958)

* small improvements

* fix: return empty iterator if no json present

* use time.Tick

* changes
This commit is contained in:
UUBulb
2025-01-19 21:22:00 +08:00
committed by GitHub
parent 844865e2c1
commit 4b1af369e3
10 changed files with 34 additions and 34 deletions

View File

@@ -247,7 +247,7 @@ func SendNotification(notificationGroupID uint64, desc string, muteLabel *string
if !flag {
if Conf.Debug {
log.Println("NEZHA>> 静音的重复通知:", desc, muteLabel)
log.Println("NEZHA>> Muted repeated notification", desc, muteLabel)
}
return
}
@@ -256,7 +256,7 @@ func SendNotification(notificationGroupID uint64, desc string, muteLabel *string
NotificationsLock.RLock()
defer NotificationsLock.RUnlock()
for _, n := range NotificationList[notificationGroupID] {
log.Println("NEZHA>> 尝试通知", n.Name)
log.Printf("NEZHA>> Try to notify %s", n.Name)
}
for _, n := range NotificationList[notificationGroupID] {
ns := model.NotificationServerBundle{
@@ -268,9 +268,9 @@ func SendNotification(notificationGroupID uint64, desc string, muteLabel *string
ns.Server = ext[0]
}
if err := ns.Send(desc); err != nil {
log.Println("NEZHA>> ", n.Name, " 发送通知失败:", err)
log.Printf("NEZHA>> Sending notification to %s failed: %v", n.Name, err)
} else {
log.Println("NEZHA>> ", n.Name, " 发送通知成功:")
log.Printf("NEZHA>> Sending notification to %s succeed", n.Name)
}
}
}