Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallEveryInterval ¶
StartIntervalLogger starts a goroutine that calls the provided function at regular intervals
Types ¶
type BlockProgressTracker ¶
type BlockProgressTracker struct {
// contains filtered or unexported fields
}
BlockProgressTracker tracks the progress of a migration by block number.
func NewBlockProgressTracker ¶
func NewBlockProgressTracker( logger utils.SimpleLogger, totalBlocks uint64, initialCompletedBlocks uint64, ) *BlockProgressTracker
NewBlockProgressTracker creates a new progress tracker for block-based migrations. initialCompletedBlocks allows resuming from a previous migration state.
func (*BlockProgressTracker) Elapsed ¶
func (t *BlockProgressTracker) Elapsed() time.Duration
func (*BlockProgressTracker) IncrementCompletedBlocks ¶
func (t *BlockProgressTracker) IncrementCompletedBlocks(amount uint64)
IncrementCompletedBlocks increments the completed blocks counter by the specified amount. Safe to call from multiple goroutines concurrently.
func (*BlockProgressTracker) LogProgress ¶
func (t *BlockProgressTracker) LogProgress()
LogProgress logs the progress of the migration.
Click to show internal directories.
Click to hide internal directories.