@@ -131,19 +131,17 @@ func (n *notifier) ensureRunning(ctx context.Context) (bool, error) {
131
131
// resulting in a failed attempt for each notification when their contexts are canceled; this is not possible with the
132
132
// default configurations but could be brought about by an operator tuning things incorrectly.
133
133
func (n * notifier ) process (ctx context.Context , success chan <- dispatchResult , failure chan <- dispatchResult ) error {
134
- n .log .Debug (ctx , "checking for messages to dequeue" )
135
-
136
134
msgs , err := n .fetch (ctx )
137
135
if err != nil {
138
136
return xerrors .Errorf ("fetch messages: %w" , err )
139
137
}
140
138
139
+ n .log .Debug (ctx , "dequeued messages" , slog .F ("count" , len (msgs )))
140
+
141
141
if len (msgs ) == 0 {
142
142
return nil
143
143
}
144
144
145
- n .log .Debug (ctx , "dequeued messages" , slog .F ("count" , len (msgs )))
146
-
147
145
var eg errgroup.Group
148
146
for _ , msg := range msgs {
149
147
// A message failing to be prepared correctly should not affect other messages.
@@ -167,7 +165,7 @@ func (n *notifier) process(ctx context.Context, success chan<- dispatchResult, f
167
165
return xerrors .Errorf ("dispatch failed: %w" , err )
168
166
}
169
167
170
- n .log .Debug (ctx , "dispatch completed" , slog .F ("count" , len (msgs )))
168
+ n .log .Debug (ctx , "batch completed" , slog .F ("count" , len (msgs )))
171
169
return nil
172
170
}
173
171
0 commit comments