Skip to content

Commit

Permalink
fix(relayer): restart indexer when the indexer exits due to faield AP…
Browse files Browse the repository at this point in the history
…I requests
  • Loading branch information
xiaodino committed Mar 16, 2024
1 parent ebe2985 commit 98abd8b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/relayer/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ func (i *Indexer) Start() error {
i.wg.Add(1)

go func() {
defer func() {
i.wg.Done()
}()

if err := i.filter(i.ctx); err != nil {
slog.Error("error filtering blocks", "error", err.Error())
}
Expand Down Expand Up @@ -334,6 +330,7 @@ func (i *Indexer) filter(ctx context.Context) error {
if !messageSentEvents.Next() || messageSentEvents.Event == nil {

Check failure on line 330 in packages/relayer/indexer/indexer.go

View workflow job for this annotation

GitHub Actions / lint

block should not start with a whitespace (wsl)
// use "end" not "filterEnd" here, because it will be used as the start
// of the next batch.

if err := i.handleNoEventsInBatch(ctx, i.srcChainId, int64(end)); err != nil {
return errors.Wrap(err, "i.handleNoEventsInBatch")
}
Expand Down Expand Up @@ -370,6 +367,7 @@ func (i *Indexer) filter(ctx context.Context) error {
// loop
if err := i.handleNoEventsInBatch(ctx, i.srcChainId, int64(end)); err != nil {
return errors.Wrap(err, "i.handleNoEventsInBatch")

}

Check failure on line 371 in packages/relayer/indexer/indexer.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary trailing newline (whitespace)

break
Expand Down

0 comments on commit 98abd8b

Please sign in to comment.