예제 #1
0
파일: caddy.go 프로젝트: jamesliu96/caddy
// 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
파일: caddy.go 프로젝트: kavun/caddy
// 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
}