handle error during liveness check

This commit is contained in:
Cory Schwartz 2022-05-23 09:29:11 -07:00
parent 444d0b1b8a
commit 45d15cb8ee

View File

@ -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 {