MCPcopy Create free account
hub / github.com/TalkingData/owl / checkNodesForever

Method checkNodesForever

controller/controller.go:54–65  ·  view source on GitHub ↗

checkNodesForever 持续运行检查节点函数,并维护节点数组

()

Source from the content-addressed store, hash-verified

52
53//checkNodesForever 持续运行检查节点函数,并维护节点数组
54func (c *Controller) checkNodesForever() {
55 for {
56 now := time.Now()
57 for ip, node := range c.nodePool.Nodes {
58 if now.Sub(node.Update) > time.Duration(time.Second*10) {
59 delete(c.nodePool.Nodes, ip)
60 lg.Warn("Inspector %v, %v lost from controller", ip, node.Hostname)
61 }
62 }
63 time.Sleep(time.Second * 5)
64 }
65}
66
67//receiveHearbeat 接收心跳包,并更新节点状态
68func (c *Controller) receiveHearbeat(heartbeat *types.HeartBeat) {

Callers 1

InitControllerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected