diff --git a/cmd/substreams-sink-noop/state.go b/cmd/substreams-sink-noop/state.go index c63a79f..4f8e342 100644 --- a/cmd/substreams-sink-noop/state.go +++ b/cmd/substreams-sink-noop/state.go @@ -106,7 +106,6 @@ 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() @@ -114,6 +113,8 @@ func (s *StateStore) SyncNow() error { 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)