Skip to content

Commit

Permalink
feat: notification eval period
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Nov 25, 2024
1 parent e5ee61f commit 0477419
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Notification struct {
Namespace string `json:"namespace,omitempty"`
Events pq.StringArray `json:"events" gorm:"type:[]text"`
Title string `json:"title,omitempty"`
WaitFor *time.Duration `json:"wait_for,omitempty"`
Template string `json:"template,omitempty"`
Filter string `json:"filter,omitempty"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
Expand All @@ -31,7 +30,14 @@ type Notification struct {
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`

// Error stores errors in notification filters (if any)
// Duration to wait before re-evaluating health of the resource.
WaitFor *time.Duration `json:"wait_for,omitempty"`

// Duration to wait after triggering incremental scrape for kubernetes config.
// Works together with waitFor duration.
WaitForEvalPeriod *time.Duration `json:"wait_for_eval_period,omitempty"`

// Error stores errors in notification filters (if any).
Error *string `json:"error,omitempty"`
}

Expand Down
5 changes: 5 additions & 0 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ table "notifications" {
type = bigint
comment = "duration in nanoseconds"
}
column "wait_for_eval_period" {
null = true
type = bigint
comment = "duration in nanoseconds"
}
column "group_by" {
null = true
type = sql("text[]")
Expand Down

0 comments on commit 0477419

Please sign in to comment.