Log upstream server errors

This commit is contained in:
Simon Ser 2020-02-06 16:13:29 +01:00
parent c14e26769f
commit a2d9a64bed
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -287,8 +287,13 @@ func (s *Server) connect(upstream *Upstream) error {
func (s *Server) Run() { func (s *Server) Run() {
for i := range s.Upstreams { for i := range s.Upstreams {
upstream := &s.Upstreams[i]
// TODO: retry connecting // TODO: retry connecting
go s.connect(&s.Upstreams[i]) go func() {
if err := s.connect(upstream); err != nil {
s.Logger.Printf("Failed to connect to upstream server %q: %v", upstream.Addr, err)
}
}()
} }
} }