Skip to content

Commit

Permalink
Merge pull request #605 from tablelandnetwork/bcalza/gliftimeout
Browse files Browse the repository at this point in the history
increase timeout of header by number call
  • Loading branch information
brunocalza authored Sep 27, 2023
2 parents 59c2eee + 9ebd1d3 commit a931137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/eventprocessor/eventfeed/impl/eventfeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (ef *EventFeed) getTopicsForEventTypes(ets []eventfeed.EventType) ([]common
// When this happens the provided channel will be closed.
func (ef *EventFeed) notifyNewBlocks(ctx context.Context, clientCh chan *types.Header) error {
// Always push as fast as possible the latest block.
ctx2, cls := context.WithTimeout(ctx, time.Second*10)
ctx2, cls := context.WithTimeout(ctx, time.Second*30)
defer cls()
h, err := ef.ethClient.HeaderByNumber(ctx2, nil)
if err != nil {
Expand All @@ -405,7 +405,7 @@ func (ef *EventFeed) notifyNewBlocks(ctx context.Context, clientCh chan *types.H
ef.log.Info().Msg("gracefully closing new blocks polling")
return
case <-time.After(ef.config.NewHeadPollFreq):
ctx, cls := context.WithTimeout(ctx, time.Second*10)
ctx, cls := context.WithTimeout(ctx, time.Second*30)
h, err := ef.ethClient.HeaderByNumber(ctx, nil)
if err != nil {
ef.log.Error().Err(err).Msg("get latest block")
Expand Down

0 comments on commit a931137

Please sign in to comment.