MCPcopy Index your code
hub / github.com/coder/coder / nodeKeepalive

Method nodeKeepalive

tailnet/configmaps.go:691–704  ·  view source on GitHub ↗
(lc *peerLifecycle, status *ipnstate.Status, node *tailcfg.Node)

Source from the content-addressed store, hash-verified

689}
690
691func (*configMaps) nodeKeepalive(lc *peerLifecycle, status *ipnstate.Status, node *tailcfg.Node) bool {
692 // If the peer is already active, keepalives should be enabled.
693 if peerStatus, statusOk := status.Peer[node.Key]; statusOk && peerStatus.Active {
694 return true
695 }
696 // If the peer is a destination, we should only enable keepalives if we've
697 // received the READY_FOR_HANDSHAKE.
698 if lc != nil && lc.isDestination && lc.readyForHandshake {
699 return true
700 }
701
702 // If none of the above are true, keepalives should not be enabled.
703 return false
704}
705
706type peerLifecycle struct {
707 peerID uuid.UUID

Callers 1

updatePeerLockedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected