Skip to content

Commit

Permalink
feat: notification wait for in send history
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Nov 11, 2024
1 parent ef63f28 commit e9d6729
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
NotificationStatusError = "error"
NotificationStatusSent = "sent"
NotificationStatusSending = "sending"
NotificationStatusPending = "pending" // delayed
NotificationStatusSilenced = "silenced"
NotificationStatusRepeatInterval = "repeat-interval"
)
Expand All @@ -68,6 +69,9 @@ type NotificationSendHistory struct {
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp"`
Status string `json:"status,omitempty"`

// The duration to delay sending after its creation.
Delay *time.Duration `json:"delay,omitempty"`

// Notifications that were silenced or blocked by repeat intervals
// use this counter.
Count int `json:"count"`
Expand Down
5 changes: 5 additions & 0 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ table "notification_send_history" {
null = true
type = text
}
column "delay" {
null = true
type = bigint
comment = "wait for this duration (nanoseconds)"
}
column "count" {
null = false
default = 1
Expand Down

0 comments on commit e9d6729

Please sign in to comment.