Skip to content

Commit

Permalink
fix: handle empty repeat interval
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 16, 2024
1 parent 036217e commit d623a78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notification/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ type notificationHandler struct {

// Check if notification can be sent in the interval based on group by, returns true if it can be sent
func checkRepeatInterval(ctx context.Context, n NotificationWithSpec, event models.Event) (bool, error) {
if n.RepeatInterval == "" {
return true, nil
}

interval, err := text.ParseDuration(n.RepeatInterval)
if err != nil {
return false, fmt.Errorf("error parsing repeat interval[%s] to time.Duration: %w", n.RepeatInterval, err)
Expand Down

0 comments on commit d623a78

Please sign in to comment.