diff --git a/events/events.go b/events/events.go index 598179bfc..517ac6618 100644 --- a/events/events.go +++ b/events/events.go @@ -52,6 +52,7 @@ func StartConsumers(gormDB *gorm.DB, config Config) { allConsumers := []EventConsumer{ NewTeamConsumer(gormDB), NewNotificationConsumer(gormDB), + NewNotificationSendConsumer(gormDB), NewResponderConsumer(gormDB), } if config.UpstreamPush.Valid() { diff --git a/events/notifications.go b/events/notifications.go index 7ffc0058f..b4373a978 100644 --- a/events/notifications.go +++ b/events/notifications.go @@ -34,6 +34,16 @@ func NewNotificationConsumer(db *gorm.DB) EventConsumer { } } +func NewNotificationSendConsumer(db *gorm.DB) EventConsumer { + return EventConsumer{ + WatchEvents: []string{EventNotificationSend}, + ProcessBatchFunc: processNotificationEvents, + BatchSize: 1, + Consumers: 5, + DB: db, + } +} + func processNotificationEvents(ctx *api.Context, events []api.Event) []*api.Event { var failedEvents []*api.Event for _, e := range events {