amazon events published as server side event

This commit is contained in:
2026-03-03 22:08:58 -07:00
parent 0a03b2e62e
commit 22e7b003f6
9 changed files with 186 additions and 35 deletions
+1 -10
View File
@@ -22,11 +22,6 @@ type (
trimBasePath string
basePathPattern string
}
// sender is satisfied by *Queue
sender interface {
Send(ctx context.Context, e Event) error
}
)
func (q *Queue) NewUpdateNotificationPublisher(
@@ -110,11 +105,7 @@ func (p *UpdateNotificationPublisher) Publish(pathPattern string) gin.HandlerFun
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
if err := p.queue.Send(ctx, Event{
AccountID: acctID,
Type: e,
Data: []byte(fmt.Sprintf(`{"eventType": %q}`, e)),
}); err != nil {
if err := p.queue.Send(ctx, StandardEvent(acctID, e)); err != nil {
p.log.Errorf("failed to send sse event to listener: %v", err)
}
}()