// KeepaliveCheckLoop checks whether the edge node is still alive
KeepaliveCheckLoop checks whether the edge node is still alive
// KeepaliveCheckLoop checks whether the edge node is still alive
func (mh *MessageHandle) KeepaliveCheckLoop(hi hubio.CloudHubIO, info *model.HubInfo, stop chan ExitCode) {
	for {
		keepaliveTimer := time.NewTimer(time.Duration(mh.KeepaliveInterval) * time.Second)
		select {
		case <-mh.KeepaliveChannel[info.NodeID]:
			klog.Infof("Node %s is still alive", info.NodeID)
			keepaliveTimer.Stop()
		case <-keepaliveTimer.C:
			klog.Warningf("Timeout to receive heart beat from edge node %s for project %s",
				info.NodeID, info.ProjectID)
			stop <- nodeStop
			return
		}
	}
}
func ( mh * MessageHandle ) KeepaliveCheckLoop ( hi hubio . CloudHubIO , info * model . HubInfo , stop chan ExitCode ) { for { keepaliveTimer := time . NewTimer ( time . Duration ( mh . KeepaliveInterval ) * time . Second ) select { case <- mh . KeepaliveChannel [ info . NodeID ] : klog . Infof ( " " , info . NodeID ) keepaliveTimer . Stop ( ) case <- keepaliveTimer . C : klog . Warningf ( " " , info . NodeID , info . ProjectID ) stop <- nodeStop return } } }
KeepaliveCheckLoop checks whether the edge node is still alive
KeepaliveCheckLoop checks whether the edge node is still alive