Skip to content

Commit

Permalink
handle error during liveness check
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Schwartz committed May 23, 2022
1 parent 444d0b1 commit 45d15cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion node/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 45d15cb

Please sign in to comment.