Skip to content

Commit

Permalink
clear events once we've processed them
Browse files Browse the repository at this point in the history
  • Loading branch information
jeefy committed Oct 19, 2024
1 parent 2620d16 commit 99a9b10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/jeefy/kippy/pkg/config"
"github.com/jeefy/kippy/pkg/types"
"github.com/spf13/viper"
v1 "k8s.io/api/core/v1"
)

func SendNotification(HeartBeat *types.KippyHeartbeat, HeartBeatLock *sync.Mutex) error {
Expand All @@ -26,6 +27,9 @@ func SendNotification(HeartBeat *types.KippyHeartbeat, HeartBeatLock *sync.Mutex
}
}

// Clear the events after we've filtered them
HeartBeat.Events = []*v1.Event{}

HeartBeatLock.Unlock()

// Let's not send messages unless there are actually messages
Expand Down

0 comments on commit 99a9b10

Please sign in to comment.