Skip to content

Commit

Permalink
sweepbatcher: log batcher failures
Browse files Browse the repository at this point in the history
This is useful to debug. It used to fail silently.
  • Loading branch information
starius committed Jul 8, 2024
1 parent 85b4bd0 commit bf645d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sweepbatcher/sweep_batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,22 @@ func (b *Batcher) Run(ctx context.Context) error {
case sweepReq := <-b.sweepReqs:
sweep, err := b.fetchSweep(runCtx, sweepReq)
if err != nil {
log.Warnf("fetchSweep failed: %v.", err)
return err
}

err = b.handleSweep(runCtx, sweep, sweepReq.Notifier)
if err != nil {
log.Warnf("handleSweep failed: %v.", err)
return err
}

case err := <-b.errChan:
log.Warnf("Batcher received an error: %v.", err)
return err

case <-runCtx.Done():
log.Infof("Stopping Batcher: run context cancelled.")
return runCtx.Err()
}
}
Expand Down

0 comments on commit bf645d0

Please sign in to comment.