Skip to content

Commit

Permalink
Update log message to include more detailed sync info
Browse files Browse the repository at this point in the history
Replaced debug log with an info log that provides additional context about the cursor and block metadata during the sync process. This helps in better tracking and debugging.
  • Loading branch information
billettc committed Aug 15, 2024
1 parent d492edf commit 84fa84b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/substreams-sink-noop/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,15 @@ func (s *StateStore) Start(each time.Duration) {
}

func (s *StateStore) SyncNow() error {
zlog.Debug("saving cursor to output path", zap.String("output_path", s.outputPath))
cursor, backprocessCompleted, headBlockReached := s.fetcher()

s.state.Cursor = cursor.String()
s.state.Block.ID = cursor.Block().ID()
s.state.Block.Number = cursor.Block().Num()
s.state.LastSyncedAt = time.Now().Local()

zlog.Info("saving cursor to output path", zap.String("output_path", s.outputPath), zap.Uint64("block_num", s.state.Block.Number), zap.String("block_id", s.state.Block.ID), zap.String("cursor", s.state.Cursor))

if backprocessCompleted && s.state.BackprocessingCompletedAt.IsZero() {
s.state.BackprocessingCompletedAt = s.state.LastSyncedAt
s.state.BackprocessingDuration = s.state.BackprocessingCompletedAt.Sub(s.state.StartedAt)
Expand Down

0 comments on commit 84fa84b

Please sign in to comment.