Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Mar 2, 2024
1 parent 199ea82 commit ec0ceee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/relayer/indexer/handle_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ 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)

return nil
}

// If the status from contract is done, update the database
if i.watchMode == CrawlPastBlocks && eventStatus == relayer.EventStatusDone {
slog.Info("updating status for msgHash", "msgHash", common.Hash(event.MsgHash).Hex())

if err := i.eventRepo.UpdateStatus(ctx, id, relayer.EventStatusDone); err != nil {
return errors.Wrap(err, fmt.Sprintf("i.eventRepo.UpdateStatus, id: %v", id))
}
Expand Down

0 comments on commit ec0ceee

Please sign in to comment.