(err error)
| 112 | } |
| 113 | |
| 114 | func (issue *systemIssue) notify(err error) { //nolint // TODO: Should we use the error? |
| 115 | systemIssueNotificationLock.Lock() |
| 116 | defer systemIssueNotificationLock.Unlock() |
| 117 | |
| 118 | if systemIssueNotification != nil { |
| 119 | // Ignore duplicate notification. |
| 120 | if issue.id == systemIssueNotification.EventID { |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | // Remove old notification. |
| 125 | systemIssueNotification.Delete() |
| 126 | } |
| 127 | |
| 128 | // Create new notification. |
| 129 | n := ¬ifications.Notification{ |
| 130 | EventID: issue.id, |
| 131 | Type: issue.level, |
| 132 | Title: issue.title, |
| 133 | Message: issue.message, |
| 134 | ShowOnSystem: true, |
| 135 | AvailableActions: issue.actions, |
| 136 | } |
| 137 | notifications.Notify(n) |
| 138 | |
| 139 | systemIssueNotification = n |
| 140 | n.SyncWithState(module.states) |
| 141 | } |
| 142 | |
| 143 | func resetSystemIssue() { |
| 144 | systemIssueNotificationLock.Lock() |
nothing calls this directly
no test coverage detected