shutdowncheck

package
v7.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShutdownTracker

type ShutdownTracker struct {
	// contains filtered or unexported fields
}

ShutdownTracker is a service that reports previous unclean shutdowns upon start. It needs to be started after a successful start-up and stopped after a successful shutdown, just before the db is closed.

func NewShutdownTracker

func NewShutdownTracker(db ethdb.Database) *ShutdownTracker

NewShutdownTracker creates a new ShutdownTracker instance and has no other side-effect.

func (*ShutdownTracker) MarkStartup

func (t *ShutdownTracker) MarkStartup()

MarkStartup is to be called in the beginning when the node starts. It will: - Push a new startup marker to the db - Report previous unclean shutdowns

func (*ShutdownTracker) Start

func (t *ShutdownTracker) Start()

Start runs an event loop that updates the current marker's timestamp every 5 minutes.

func (*ShutdownTracker) Stop

func (t *ShutdownTracker) Stop()

Stop will stop the update loop and clear the current marker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL