Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd23e35579 |
+11
-13
@@ -54,11 +54,8 @@ const (
|
|||||||
// runs that does not parse, a replacement of the lookup database that
|
// runs that does not parse, a replacement of the lookup database that
|
||||||
// cannot be read, or a state file that cannot be written.
|
// cannot be read, or a state file that cannot be written.
|
||||||
EventFileError = "file_error"
|
EventFileError = "file_error"
|
||||||
// EventSummary is the summary sent as an hour ends: of the alerts held
|
// EventSummary is the summary of the alerts an hour held back past
|
||||||
// back in it past SWWAF_ALERT_MAX_PER_HOUR, and of the repeats held
|
// SWWAF_ALERT_MAX_PER_HOUR. SWWAF_ALERT_EVENTS does not name it.
|
||||||
// back by the cooldowns dropped as it ends, which no alert let through
|
|
||||||
// has given. It is sent with SWWAF_ALERT_MAX_PER_HOUR off too, for
|
|
||||||
// those repeats. SWWAF_ALERT_EVENTS does not name it.
|
|
||||||
EventSummary = "summary"
|
EventSummary = "summary"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -314,14 +311,15 @@ func New(params Params) *Queue {
|
|||||||
// unless no destination is set or SWWAF_ALERT_EVENTS leaves its event
|
// unless no destination is set or SWWAF_ALERT_EVENTS leaves its event
|
||||||
// out. It gives alert the instance and the time. An alert that repeats
|
// out. It gives alert the instance and the time. An alert that repeats
|
||||||
// the last one let through less than Cooldown before is held back and
|
// the last one let through less than Cooldown before is held back and
|
||||||
// counted. The next one let through gives that count, unless an hour of
|
// counted, and the next one let through gives that count. Past MaxPerHour
|
||||||
// the clock ends first after the cooldown has run out: the cooldown is
|
// alerts let through in the hour under way, by the clock, an alert is
|
||||||
// then dropped, and that hour's summary gives the count. Past MaxPerHour
|
// held back for that hour's summary instead, which is sent once the hour
|
||||||
// alerts let through in the hour under way, an alert is held back for
|
// has ended; it starts no cooldown, and the repeats held back before it
|
||||||
// that hour's summary instead, which is sent once the hour has ended; it
|
// are given by that summary, as their cooldown, which has run out, is
|
||||||
// starts no cooldown. Raise never waits: an alert let through joins the
|
// dropped when the hour ends. Raise never waits: an alert
|
||||||
// queue of each destination, from which Run sends it, and with queueSize
|
// let through joins the queue of each destination, from which Run sends
|
||||||
// alerts waiting for a destination, the oldest is dropped.
|
// it, and with queueSize alerts waiting for a destination, the oldest is
|
||||||
|
// dropped.
|
||||||
func (q *Queue) Raise(alert Alert) {
|
func (q *Queue) Raise(alert Alert) {
|
||||||
if len(q.destinations) == 0 || !slices.Contains(q.params.Events, alert.Event) {
|
if len(q.destinations) == 0 || !slices.Contains(q.params.Events, alert.Event) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user