func()

in internal/daemon/daemon.go [34:55]


func (p *program) Start(s service.Service) error {
	log.Logger.Info("Service starts.")

	if p.osCollection != nil {
		go p.osCollection()
	}
	if p.sqlCollection != nil {
		go p.sqlCollection()
	}

	go func() {
		// Wait for 5 minutes in case the service was killed after it starts.
		// The agent logs the status as Running after the first 5 mins wait. Then it logs the status
		// in every hour.
		time.Sleep(5 * time.Minute)
		for {
			p.statusLogger.Running()
			time.Sleep(time.Hour)
		}
	}()
	return nil
}