From a088919043d045c7cf849345f6c0c4ad38017e9a Mon Sep 17 00:00:00 2001 From: Ryan Connell <7585908+RyanConnell@users.noreply.github.com> Date: Sun, 31 Dec 2023 02:56:46 +0000 Subject: [PATCH] fix: avoid sending events multiple times per run If multiple artists matched an event it was possible that we would notify twice. Breaking early should prevent this. --- internal/watcher/watcher.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go index f0167d2..a36cb57 100644 --- a/internal/watcher/watcher.go +++ b/internal/watcher/watcher.go @@ -65,6 +65,7 @@ func (w *Watcher) FindEvents(diffMode bool) ([]*ticketmaster.Event, error) { if w.trackedArtists.Contains(artist.Name) { matchingEvents = append(matchingEvents, event) matchingEventIDs = append(matchingEventIDs, event.ID) + break } } }