Skip to content

Commit 8262ddc

Browse files
committed
small changes, wordings comments and logs
1 parent cfb43f9 commit 8262ddc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

internal/database/dbpebble/store.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func NewStore(db *pebble.DB) *Store {
5050
}
5151

5252
func (s *Store) collectAndWrite(block *database.DBBlock) error {
53+
// with current logic channel size is irrelevant as it's not being used
54+
// we need to untangle bacth collection and the channel length
55+
// then we can continue computations while
5356
s.batchSync.Lock()
5457
if s.dbBatch == nil {
5558
s.dbBatch = s.DB.NewBatch()
@@ -75,7 +78,7 @@ func (s *Store) collectAndWrite(block *database.DBBlock) error {
7578
s.dbBatch = s.DB.NewBatch()
7679
s.batchCounter = 0
7780
}
78-
err := attachBlcokToBatch(s.dbBatch, block)
81+
err := attachBlockToBatch(s.dbBatch, block)
7982
if err != nil {
8083
logging.L.Err(err).Msg("failed to attach to batch")
8184
return err
@@ -110,7 +113,7 @@ func (s *Store) commitBatch() error {
110113
return nil
111114
}
112115

113-
func attachBlcokToBatch(batch *pebble.Batch, block *database.DBBlock) error {
116+
func attachBlockToBatch(batch *pebble.Batch, block *database.DBBlock) error {
114117
blockHash := block.Hash[:]
115118
txs := block.Txs
116119
height := block.Height

internal/indexer/builder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func (b *Builder) SyncBlocks(
175175
logging.L.Info().
176176
Uint32("height", syncTip).
177177
Msgf("current indexed chain tip %d", syncTip)
178+
logging.L.Info().
179+
Int("backlog_chan_pull", len(b.newBlockChan)).
180+
Int("backlog_chan_db_writer", len(b.writerChan)).
181+
Msg("new_tick_report")
178182
case <-tickerReports:
179183
logging.L.Trace().
180184
Int("backlog_chan_pull", len(b.newBlockChan)).

0 commit comments

Comments
 (0)