Skip to content

Commit

Permalink
Fix: receiver retry
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jan 2, 2024
1 parent f3900b4 commit 67d40ac
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cmd/indexer/indexer/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,18 @@ func (r *Receiver) get(ctx context.Context, level int64) (Block, error) {
}

func (r *Receiver) job(ctx context.Context, level int64) {
block, err := r.get(ctx, level)
if err != nil {
if !errors.Is(err, context.Canceled) {
log.Err(err).Int64("block", level).Msg("Receiver.get")
r.pool.AddTask(level)
for {
block, err := r.get(ctx, level)
if err == nil {
r.blocks <- &block
r.inProcess.Delete(level)
break
}
return

if errors.Is(err, context.Canceled) {
return
}

log.Err(err).Int64("block", level).Msg("Receiver.get")
}
r.blocks <- &block
r.inProcess.Delete(level)
}

0 comments on commit 67d40ac

Please sign in to comment.