mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 13:40:06 +00:00
add cron, nat api & refactor alert rule (#459)
* add cron api & refactor alert rule * add nat api * fix swagger * remove unnecessary steps
This commit is contained in:
@@ -49,14 +49,13 @@ func loadNotifications() {
|
||||
groupNotifications[n.NotificationGroupID] = append(groupNotifications[n.NotificationGroupID], n.NotificationID)
|
||||
}
|
||||
|
||||
var notifications []model.Notification
|
||||
if err := DB.Find(¬ifications).Error; err != nil {
|
||||
if err := DB.Find(&NotificationListSorted).Error; err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
NotificationMap = make(map[uint64]*model.Notification, len(notifications))
|
||||
for i := range notifications {
|
||||
NotificationMap[notifications[i].ID] = ¬ifications[i]
|
||||
NotificationMap = make(map[uint64]*model.Notification, len(NotificationListSorted))
|
||||
for i := range NotificationListSorted {
|
||||
NotificationMap[NotificationListSorted[i].ID] = NotificationListSorted[i]
|
||||
}
|
||||
|
||||
for gid, nids := range groupNotifications {
|
||||
@@ -75,7 +74,6 @@ func loadNotifications() {
|
||||
}
|
||||
|
||||
NotificationsLock.Unlock()
|
||||
UpdateNotificationList()
|
||||
}
|
||||
|
||||
func UpdateNotificationList() {
|
||||
|
||||
Reference in New Issue
Block a user