Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
poopoothegorilla committed Jan 24, 2024
1 parent a9b2f49 commit 55d9ace
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions common/txmgr/strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (s DropOldestStrategy) PruneQueue(ctx context.Context, pruneService txmgrty
ctx, cancel = context.WithTimeout(ctx, s.queryTimeout)
defer cancel()

// NOTE: We prune one less than the queue size because we will be adding a new transaction to the queue right after this PruneQueue call
ids, err = pruneService.PruneUnstartedTxQueue(ctx, s.queueSize-1, s.subject)
if err != nil {
return ids, fmt.Errorf("DropOldestStrategy#PruneQueue failed: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) createTxnA
if len(pruned) > 0 {
b.logger.Warnw(fmt.Sprintf("Pruned %d old unstarted transactions", len(pruned)),
"subject", txRequest.Strategy.Subject(),
"pruned", pruned,
"pruned-tx-ids", pruned,
)
}

Expand All @@ -710,7 +710,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) createTxnA
"fromAddress", txRequest.FromAddress,
"toAddress", txRequest.ToAddress,
"meta", txRequest.Meta,
"replacementID", tx.ID,
"transactionID", tx.ID,
)

return tx, nil
Expand Down

0 comments on commit 55d9ace

Please sign in to comment.