Skip to content

Commit

Permalink
Add debug info to ew connection manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner committed Nov 26, 2023
1 parent 730b4d8 commit f83822f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions p2p/connmgr/connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ import (
"github.com/bahner/go-ma-actor/config"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
p2pConnmgr "github.com/libp2p/go-libp2p/p2p/net/connmgr"
log "github.com/sirupsen/logrus"
)

func Init() (*p2pConnmgr.BasicConnMgr, error) {

withGracePeriod := connmgr.WithGracePeriod(config.GetConnMgrGracePeriod())
gracePeriod := config.GetConnMgrGracePeriod()
withGracePeriod := connmgr.WithGracePeriod(gracePeriod)
log.Infof("Connection manager grace period: %v", gracePeriod)

lowWaterMark := config.GetLowWaterMark()
log.Infof("Connection manager low water mark: %v", lowWaterMark)
highWaterMark := config.GetHighWaterMark()
log.Infof("Connection manager high water mark: %v", highWaterMark)

return p2pConnmgr.NewConnManager(
config.GetLowWaterMark(),
config.GetHighWaterMark(),
lowWaterMark,
highWaterMark,
withGracePeriod,
)

Expand Down

0 comments on commit f83822f

Please sign in to comment.