mirror of https://github.com/docker/docs.git
emitCustomEvent -> emitEvent
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
08a17cd2e6
commit
59fb880b75
|
@ -95,7 +95,7 @@ func (n *Node) connectClient(client dockerclient.Client) error {
|
||||||
|
|
||||||
// Start monitoring events from the Node.
|
// Start monitoring events from the Node.
|
||||||
n.client.StartMonitorEvents(n.handler)
|
n.client.StartMonitorEvents(n.handler)
|
||||||
n.emitCustomEvent("node_connect")
|
n.emitEvent("node_connect")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ func (n *Node) refreshLoop() {
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if n.healthy {
|
if n.healthy {
|
||||||
n.emitCustomEvent("node_disconnect")
|
n.emitEvent("node_disconnect")
|
||||||
}
|
}
|
||||||
n.healthy = false
|
n.healthy = false
|
||||||
log.Errorf("[%s/%s] Flagging node as dead. Updated state failed: %v", n.ID, n.Name, err)
|
log.Errorf("[%s/%s] Flagging node as dead. Updated state failed: %v", n.ID, n.Name, err)
|
||||||
|
@ -270,7 +270,7 @@ func (n *Node) refreshLoop() {
|
||||||
log.Infof("[%s/%s] Node came back to life. Hooray!", n.ID, n.Name)
|
log.Infof("[%s/%s] Node came back to life. Hooray!", n.ID, n.Name)
|
||||||
n.client.StopAllMonitorEvents()
|
n.client.StopAllMonitorEvents()
|
||||||
n.client.StartMonitorEvents(n.handler)
|
n.client.StartMonitorEvents(n.handler)
|
||||||
n.emitCustomEvent("node_reconnect")
|
n.emitEvent("node_reconnect")
|
||||||
if err := n.updateSpecs(); err != nil {
|
if err := n.updateSpecs(); err != nil {
|
||||||
log.Errorf("[%s/%s] Update node specs failed: %v", n.ID, n.Name, err)
|
log.Errorf("[%s/%s] Update node specs failed: %v", n.ID, n.Name, err)
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ func (n *Node) refreshLoop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) emitCustomEvent(event string) {
|
func (n *Node) emitEvent(event string) {
|
||||||
// If there is no event handler registered, abort right now.
|
// If there is no event handler registered, abort right now.
|
||||||
if n.eventHandler == nil {
|
if n.eventHandler == nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue