shutdowncheck

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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