// check is invoked periodically to perform the TCP check
check is invoked periodically to perform the TCP check
// check is invoked periodically to perform the TCP check
func (c *CheckTCP) check() {
	var currentStatus string
	previousStatus := c.Status
	conn, err := c.dialer.Dial(`tcp`, c.tcp)
	if err != nil {
		logrus.Warnf("[health-check] TCP Check is failing => %s", err)
		currentStatus = BAD
	} else {
		logrus.Debugf("[health-check] TCP check on '%v' at '%s' is passing", c.DestinationID, c.tcp)
		currentStatus = OK
		conn.Close()
	}
	if currentStatus != previousStatus {
		c.Status = currentStatus
		c.updateCh <- true
	}
}
func ( c * CheckTCP ) check ( ) { var currentStatus string previousStatus := c . Status conn , err := c . dialer . Dial ( `tcp` , c . tcp ) if err != nil { logrus . Warnf ( " " , err ) currentStatus = BAD } else { logrus . Debugf ( " " , c . DestinationID , c . tcp ) currentStatus = OK conn . Close ( ) } if currentStatus != previousStatus { c . Status = currentStatus c . updateCh <- true } }
check is invoked periodically to perform the TCP check
check is invoked periodically to perform the TCP check