mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-25 08:11:18 +02:00
Merge pull request #7204 from YusukeShimizu/fix-liveliness-typo
Unified valiable name and comment
This commit is contained in:
commit
e614d806e5
@ -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
|
// 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
|
// 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
|
// 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.
|
// to print our reason for shutdown.
|
||||||
type shutdownFunc func(format string, params ...interface{})
|
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.
|
// ensure that lnd has access to all critical resources.
|
||||||
type Monitor struct {
|
type Monitor struct {
|
||||||
started int32 // To be used atomically.
|
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 {
|
type Observation struct {
|
||||||
// Name describes the health check.
|
// Name describes the health check.
|
||||||
Name string
|
Name string
|
||||||
|
24
server.go
24
server.go
@ -318,8 +318,8 @@ type server struct {
|
|||||||
|
|
||||||
hostAnn *netann.HostAnnouncer
|
hostAnn *netann.HostAnnouncer
|
||||||
|
|
||||||
// livelinessMonitor monitors that lnd has access to critical resources.
|
// livenessMonitor monitors that lnd has access to critical resources.
|
||||||
livelinessMonitor *healthcheck.Monitor
|
livenessMonitor *healthcheck.Monitor
|
||||||
|
|
||||||
customMessageServer *subscribe.Server
|
customMessageServer *subscribe.Server
|
||||||
|
|
||||||
@ -1545,7 +1545,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create liveliness monitor.
|
// Create liveness monitor.
|
||||||
s.createLivenessMonitor(cfg, cc)
|
s.createLivenessMonitor(cfg, cc)
|
||||||
|
|
||||||
// Create the connection manager which will be responsible for
|
// 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
|
// 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,
|
// health checks,
|
||||||
// - chainHealthCheck (will be disabled for --nochainbackend mode)
|
// - chainHealthCheck (will be disabled for --nochainbackend mode)
|
||||||
// - diskCheck
|
// - 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
|
// If we have not disabled all of our health checks, we create a
|
||||||
// liveliness monitor with our configured checks.
|
// liveness monitor with our configured checks.
|
||||||
s.livelinessMonitor = healthcheck.NewMonitor(
|
s.livenessMonitor = healthcheck.NewMonitor(
|
||||||
&healthcheck.Config{
|
&healthcheck.Config{
|
||||||
Checks: checks,
|
Checks: checks,
|
||||||
Shutdown: srvrLog.Criticalf,
|
Shutdown: srvrLog.Criticalf,
|
||||||
@ -1775,12 +1775,12 @@ func (s *server) Start() error {
|
|||||||
cleanup = cleanup.add(s.hostAnn.Stop)
|
cleanup = cleanup.add(s.hostAnn.Stop)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.livelinessMonitor != nil {
|
if s.livenessMonitor != nil {
|
||||||
if err := s.livelinessMonitor.Start(); err != nil {
|
if err := s.livenessMonitor.Start(); err != nil {
|
||||||
startErr = err
|
startErr = err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cleanup = cleanup.add(s.livelinessMonitor.Stop)
|
cleanup = cleanup.add(s.livenessMonitor.Stop)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the notification server. This is used so channel
|
// Start the notification server. This is used so channel
|
||||||
@ -2239,9 +2239,9 @@ func (s *server) Stop() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.livelinessMonitor != nil {
|
if s.livenessMonitor != nil {
|
||||||
if err := s.livelinessMonitor.Stop(); err != nil {
|
if err := s.livenessMonitor.Stop(); err != nil {
|
||||||
srvrLog.Warnf("unable to shutdown liveliness "+
|
srvrLog.Warnf("unable to shutdown liveness "+
|
||||||
"monitor: %v", err)
|
"monitor: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user