From 274938ed45ad2e6395349667487d1e45a5fc7194 Mon Sep 17 00:00:00 2001 From: bruwbird Date: Fri, 25 Nov 2022 21:52:00 +0900 Subject: [PATCH] fix typo liveliness --- healthcheck/healthcheck.go | 6 +++--- server.go | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/healthcheck/healthcheck.go b/healthcheck/healthcheck.go index e314f8d19..1cf6bd98c 100644 --- a/healthcheck/healthcheck.go +++ b/healthcheck/healthcheck.go @@ -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 @@ -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. @@ -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 diff --git a/server.go b/server.go index 6e44cbd6b..4da9eb6fb 100644 --- a/server.go +++ b/server.go @@ -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 @@ -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 @@ -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 @@ -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, @@ -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 @@ -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) } }