func (d *dispatcher) processNodeStatus(nodeName, clientIP string, status types.NodeStatus) (bool, error) {
	var warmingUp bool

	d.store.Lock()
	if !d.store.active {
		warmingUp = true
	}
	node := d.store.getOrCreateNodeStore(nodeName, clientIP)
	d.store.Unlock()

	node.Lock()
	defer node.Unlock()
	node.lastStatus = status
	node.heartbeat = timestampNow()

	if node.lastConfigChange == status.LastChange {
		// Node-agent is up to date
		return true, nil
	}
	if warmingUp {
		// During the initial warmup phase, we are counting active nodes
		// without dispatching configurations.
		// We tell node-agents they are up to date to keep their cached
		// configurations running while we finish the warmup phase.
		return true, nil
	}

	// Node-agent needs to pull updated configs
	return false, nil
}
// processNodeStatus keeps the node's status in the store, and returns true
// if the last configuration change matches the one sent by the node agent.
processNodeStatus keeps the node's status in the store, and returns true
if the last configuration change matches the one sent by the node agent.
// processNodeStatus keeps the node ' s status in the store and returns true // if the last configuration change matches the one sent by the node agent .
func (d *dispatcher) processNodeStatus(nodeName, clientIP string, status types.NodeStatus) (bool, error) {
	var warmingUp bool
	d.store.Lock()
	if !d.store.active {
		warmingUp = true
	}
	node := d.store.getOrCreateNodeStore(nodeName, clientIP)
	d.store.Unlock()
	node.Lock()
	defer node.Unlock()
	node.lastStatus = status
	node.heartbeat = timestampNow()
	if node.lastConfigChange == status.LastChange {
		return true, nil
	}
	if warmingUp {
		return true, nil
	}
	return false, nil
}
func ( d * dispatcher ) processNodeStatus ( nodeName , clientIP string , status types . NodeStatus ) ( bool , error ) { var warmingUp bool d . store . Lock ( ) if ! d . store . active { warmingUp = true } node := d . store . getOrCreateNodeStore ( nodeName , clientIP ) d . store . Unlock ( ) node . Lock ( ) defer node . Unlock ( ) node . lastStatus = status node . heartbeat = timestampNow ( ) if node . lastConfigChange == status . LastChange { return true , nil } if warmingUp { return true , nil } return false , nil }
processNodeStatus keeps the node's status in the store, and returns true
if the last configuration change matches the one sent by the node agent.
processNodeStatus keeps the node ' s status in the store and returns true if the last configuration change matches the one sent by the node agent .
// Node-agent is up to date // During the initial warmup phase, we are counting active nodes // without dispatching configurations. // We tell node-agents they are up to date to keep their cached // configurations running while we finish the warmup phase. // Node-agent needs to pull updated configs