handle error during liveness check
This commit is contained in:
parent
444d0b1b8a
commit
45d15cb8ee
@ -6,9 +6,12 @@ import (
|
||||
"time"
|
||||
|
||||
lapi "github.com/filecoin-project/lotus/api"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
)
|
||||
|
||||
var healthlog = logging.Logger("healthcheck")
|
||||
|
||||
type HealthHandler struct {
|
||||
healthy bool
|
||||
}
|
||||
@ -36,7 +39,9 @@ func NewLiveHandler(api lapi.FullNode) *HealthHandler {
|
||||
minutely := time.NewTicker(time.Minute)
|
||||
headCh, err := api.ChainNotify(ctx)
|
||||
if err != nil {
|
||||
//TODO
|
||||
healthlog.Warnf("failed to instantiate chain notify channel; liveliness cannot be determined. %s", err)
|
||||
h.SetHealthy(false)
|
||||
return
|
||||
}
|
||||
for {
|
||||
select {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user