Skip to content

Commit

Permalink
fix(mailman): check on startup and fix trace
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNotGoodName committed Sep 16, 2023
1 parent 69ba72e commit 76bd9c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/mailman/mailman.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func New(id int, app core.App, bus core.Bus, fileStore endpoint.FileStore, endpo

func (m Mailman) Serve(ctx context.Context) error {
checkC := make(chan struct{}, 1)
checkC <- struct{}{}

release := m.bus.OnMailmanEnqueued(func(ctx context.Context, evt models.EventMailmanEnqueued) error {
select {
case checkC <- struct{}{}:
Expand Down Expand Up @@ -65,7 +67,7 @@ func (m Mailman) Serve(ctx context.Context) error {
}
env := *maybeEnv

tracer = tracer.Sticky(trace.WithEnvelope(env.Message.ID))
tracer := tracer.Sticky(trace.WithEnvelope(env.Message.ID))

if err := m.send(ctx, tracer, env); err != nil {
tracer.Trace(ctx, "mailman.error", trace.WithError(err))
Expand Down

0 comments on commit 76bd9c9

Please sign in to comment.