Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Jan 20, 2023
1 parent b8b86f0 commit d7ffa06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions cmd/soroban-rpc/internal/ledgerentry_storage/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,16 @@ func (s *sqlDB) NewLedgerEntryUpdaterTx(forLedgerSequence uint32, maxBatchSize i
}
ret := &ledgerUpdaterTx{
tx: tx,
stmtCache: sq.NewStmtCache(tx),
postWriteCommitHook: s.postWriteCommitHook,
forLedgerSequence: forLedgerSequence,
maxBatchSize: maxBatchSize,
buffer: xdr.NewEncodingBuffer(),
keyToEntryBatch: make(map[string]*string, maxBatchSize),
}
ret.stmtCache = sq.NewStmtCache(tx)
return ret, nil
}

func (l *ledgerUpdaterTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) {
return l.tx.PrepareContext(ctx, query)
}

func (l *ledgerUpdaterTx) flushLedgerEntryBatch() error {
upsertCount := 0
upsertSQL := sq.StatementBuilder.RunWith(l.stmtCache).Replace(ledgerEntriesTableName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ledgerentry_storage

import (
"context"
"fmt"
"io"
"sync"
"time"
Expand Down Expand Up @@ -154,7 +153,7 @@ func (ls *ledgerEntryStorage) run(ctx context.Context, archive historyarchive.Ar

nextLedger := startCheckpointLedger + 1
for {
fmt.Println("Processing txmeta of ledger", nextLedger)
ls.logger.Info("Processing txmeta of ledger", nextLedger)
reader, err := ingest.NewLedgerChangeReader(ctx, ledgerBackend, ls.networkPassPhrase, nextLedger)
if err != nil {
panic(err)
Expand Down

0 comments on commit d7ffa06

Please sign in to comment.