Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodino committed Mar 16, 2024
1 parent 32f9e3d commit c32f20b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/relayer/indexer/handle_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (i *Indexer) handleEvent(
return errors.Wrap(err, "eventTypeAmountAndCanonicalTokenFromEvent(event)")
}

// TODO(xiaodino): Change to batch query

// check if we have an existing event already. this is mostly likely only true
// in the case of us crawling past blocks.
existingEvent, err := i.eventRepo.FirstByEventAndMsgHash(
Expand Down Expand Up @@ -141,8 +143,7 @@ func (i *Indexer) handleEvent(
if i.watchMode == CrawlPastBlocks && eventStatus == existingEvent.Status {
// If the status from contract matches the existing event status,
// we can return early as this message has been processed as expected.
slog.Info("crawler returning early", "eventStatus", eventStatus, "existingEvent.Status", existingEvent.Status)

// slog.Info("crawler returning early", "eventStatus", eventStatus, "existingEvent.Status", existingEvent.Status)
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions packages/relayer/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ func (i *Indexer) filter(ctx context.Context) error {
relayer.ErrorEvents.Inc()
// log error but always return nil to keep other goroutines active
slog.Error("error handling event", "err", err.Error())
} else {
slog.Info("handled event successfully")
}

return nil
Expand Down

0 comments on commit c32f20b

Please sign in to comment.