code: func (d *daemonDiscoveryReloader) advertiseHeartbeat(address string) {
  	var ready bool
  	if err := d.initHeartbeat(address); err == nil {
  		ready = true
  		close(d.readyCh)
  	} else {
  		logrus.WithError(err).Debug("First discovery heartbeat failed")
  	}
  
  	for {
  		select {
  		case <-d.ticker.C:
  			if err := d.backend.Register(address); err != nil {
  				logrus.Warnf("Registering as %q in discovery failed: %v", address, err)
  			} else {
  				if !ready {
  					close(d.readyCh)
  					ready = true
  				}
  			}
  		case <-d.term:
  			return
  		}
  	}
  }
docs: // advertiseHeartbeat registers the current node against the discovery backend using the specified
  // address. The function never returns, as registration against the backend comes with a TTL and
  // requires regular heartbeats.