Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions sqlitestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ func (s *SQLiteStore) FollowEvents(ctx context.Context, iterator arkivevents.Bat
for batch := range iterator {
if batch.Error != nil {
return fmt.Errorf("failed to follow events: %w", batch.Error)

}

totalCreates := 0
totalUpdates := 0
totalDeletes := 0
totalExtends := 0
totalOwnerChanges := 0

err := func() error {

tx, err := s.writePool.BeginTx(ctx, &sql.TxOptions{
Expand Down Expand Up @@ -445,7 +450,11 @@ func (s *SQLiteStore) FollowEvents(ctx context.Context, iterator arkivevents.Bat
}

s.log.Info("block updated", "block", block.Number, "creates", creates, "updates", updates, "deletes", deletes, "extends", extends, "ownerChanges", ownerChanges)

totalCreates += creates
totalUpdates += updates
totalDeletes += deletes
totalExtends += extends
totalOwnerChanges += ownerChanges
}

err = st.UpsertLastBlock(ctx, lastBlock)
Expand All @@ -463,7 +472,7 @@ func (s *SQLiteStore) FollowEvents(ctx context.Context, iterator arkivevents.Bat
return fmt.Errorf("failed to commit transaction: %w", err)
}

s.log.Info("batch processed", "firstBlock", firstBlock, "lastBlock", lastBlock, "processingTime", time.Since(startTime))
s.log.Info("batch processed", "firstBlock", firstBlock, "lastBlock", lastBlock, "processingTime", time.Since(startTime).Milliseconds(), "creates", totalCreates, "updates", totalUpdates, "deletes", totalDeletes, "extends", totalExtends, "ownerChanges", totalOwnerChanges)

return nil
}()
Expand Down