fix: notifier groups cache not initialized (#995)

This commit is contained in:
UUBulb
2025-02-17 20:14:38 +08:00
committed by GitHub
parent 65f9db7d5a
commit 029d6dbd5f
2 changed files with 7 additions and 0 deletions

View File

@@ -54,6 +54,12 @@ func loadNotifications() {
panic(err)
}
var groups []model.NotificationGroup
DB.Find(&groups)
for _, grp := range groups {
NotificationGroup[grp.ID] = grp.Name
}
NotificationMap = make(map[uint64]*model.Notification, len(NotificationListSorted))
for i := range NotificationListSorted {
NotificationMap[NotificationListSorted[i].ID] = NotificationListSorted[i]