Skip to content

Commit

Permalink
increase timeout of header by number call
Browse files Browse the repository at this point in the history
glif.io timeout

Signed-off-by: Bruno Calza <[email protected]>
  • Loading branch information
brunocalza committed Sep 27, 2023
1 parent 59c2eee commit 9ebd1d3
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 9ebd1d3

Please sign in to comment.