From 99a9b108021205fc0bbaa63069f03b52bce9abd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Sica Date: Sat, 19 Oct 2024 08:48:21 -0500 Subject: [PATCH] clear events once we've processed them --- pkg/notify/notify.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/notify/notify.go b/pkg/notify/notify.go index 3f7c3e6..0b2e717 100644 --- a/pkg/notify/notify.go +++ b/pkg/notify/notify.go @@ -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 { @@ -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