Skip to content

Commit

Permalink
update: use for range instead endless for loop with select for channel
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed May 24, 2024
1 parent 069c20e commit fe02b9c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/broadcaster/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ func (r *Runner) run(ctx context.Context) error {
}

func (r *Runner) waitForTxErrors(ctx context.Context) {
for {
select {
case errData := <-r.errChan:
r.updateAirdropStatus(ctx, errData.airdrop.ID, errData.tx.Hash().String(), data.TxStatusFailed)
return
}
for errData := range r.errChan {
r.updateAirdropStatus(ctx, errData.airdrop.ID, errData.tx.Hash().String(), data.TxStatusFailed)
}
}

Expand Down

0 comments on commit fe02b9c

Please sign in to comment.