Skip to content

Commit

Permalink
fix typo liveliness
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeShimizu committed Nov 25, 2022
1 parent 71fc52d commit 274938e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package healthcheck contains a monitor which takes a set of liveliness checks
// Package healthcheck contains a monitor which takes a set of liveness checks
// which it periodically checks. If a check fails after its configured number
// of allowed call attempts, the monitor will send a request to shutdown using
// the function is is provided in its config. Checks are dispatched in their own
Expand Down Expand Up @@ -30,7 +30,7 @@ type Config struct {
// to print our reason for shutdown.
type shutdownFunc func(format string, params ...interface{})

// Monitor periodically checks a series of configured liveliness checks to
// Monitor periodically checks a series of configured liveness checks to
// ensure that lnd has access to all critical resources.
type Monitor struct {
started int32 // To be used atomically.
Expand Down Expand Up @@ -112,7 +112,7 @@ func CreateCheck(checkFunc func() error) func() chan error {
}
}

// Observation represents a liveliness check that we periodically check.
// Observation represents a liveness check that we periodically check.
type Observation struct {
// Name describes the health check.
Name string
Expand Down
24 changes: 12 additions & 12 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ type server struct {

hostAnn *netann.HostAnnouncer

// livelinessMonitor monitors that lnd has access to critical resources.
livelinessMonitor *healthcheck.Monitor
// livenessMonitor monitors that lnd has access to critical resources.
livenessMonitor *healthcheck.Monitor

customMessageServer *subscribe.Server

Expand Down Expand Up @@ -1545,7 +1545,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
})
}

// Create liveliness monitor.
// Create liveness monitor.
s.createLivenessMonitor(cfg, cc)

// Create the connection manager which will be responsible for
Expand Down Expand Up @@ -1584,7 +1584,7 @@ func (s *server) signAliasUpdate(u *lnwire.ChannelUpdate) (*ecdsa.Signature,
}

// createLivenessMonitor creates a set of health checks using our configured
// values and uses these checks to create a liveliness monitor. Available
// values and uses these checks to create a liveness monitor. Available
// health checks,
// - chainHealthCheck (will be disabled for --nochainbackend mode)
// - diskCheck
Expand Down Expand Up @@ -1713,8 +1713,8 @@ func (s *server) createLivenessMonitor(cfg *Config, cc *chainreg.ChainControl) {
}

// If we have not disabled all of our health checks, we create a
// liveliness monitor with our configured checks.
s.livelinessMonitor = healthcheck.NewMonitor(
// liveness monitor with our configured checks.
s.livenessMonitor = healthcheck.NewMonitor(
&healthcheck.Config{
Checks: checks,
Shutdown: srvrLog.Criticalf,
Expand Down Expand Up @@ -1775,12 +1775,12 @@ func (s *server) Start() error {
cleanup = cleanup.add(s.hostAnn.Stop)
}

if s.livelinessMonitor != nil {
if err := s.livelinessMonitor.Start(); err != nil {
if s.livenessMonitor != nil {
if err := s.livenessMonitor.Start(); err != nil {
startErr = err
return
}
cleanup = cleanup.add(s.livelinessMonitor.Stop)
cleanup = cleanup.add(s.livenessMonitor.Stop)
}

// Start the notification server. This is used so channel
Expand Down Expand Up @@ -2239,9 +2239,9 @@ func (s *server) Stop() error {
}
}

if s.livelinessMonitor != nil {
if err := s.livelinessMonitor.Stop(); err != nil {
srvrLog.Warnf("unable to shutdown liveliness "+
if s.livenessMonitor != nil {
if err := s.livenessMonitor.Stop(); err != nil {
srvrLog.Warnf("unable to shutdown liveness "+
"monitor: %v", err)
}
}
Expand Down

0 comments on commit 274938e

Please sign in to comment.