Пример #1
0
// Stop stops all servers. It blocks until they are all stopped.
// It does NOT execute shutdown callbacks that may have been
// configured by middleware (they are executed on SIGINT).
func Stop() error {
	letsencrypt.Deactivate()

	serversMu.Lock()
	for _, s := range servers {
		s.Stop() // TODO: error checking/reporting?
	}
	servers = []*server.Server{} // don't reuse servers
	serversMu.Unlock()

	return nil
}
Пример #2
0
// Stop stops all servers. It blocks until they are all stopped.
// It does NOT execute shutdown callbacks that may have been
// configured by middleware (they must be executed separately).
func Stop() error {
	letsencrypt.Deactivate()

	serversMu.Lock()
	for _, s := range servers {
		if err := s.Stop(); err != nil {
			log.Printf("[ERROR] Stopping %s: %v", s.Addr, err)
		}
	}
	servers = []*server.Server{} // don't reuse servers
	serversMu.Unlock()

	return nil
}