Add timeouts to relay methods

This commit is contained in:
Audrius Butkevicius
2015-11-23 21:14:46 +00:00
parent 45c1357bab
commit 431d51f5c4
6 changed files with 22 additions and 18 deletions

View File

@@ -110,7 +110,7 @@ func (s *Svc) CommitConfiguration(from, to config.Configuration) bool {
_, ok := s.tokens[key]
if !ok {
l.Debugln("Connecting to relay", uri)
c, err := client.NewClient(uri, s.tlsCfg.Certificates, s.invitations)
c, err := client.NewClient(uri, s.tlsCfg.Certificates, s.invitations, 10*time.Second)
if err != nil {
l.Debugln("Failed to connect to relay", uri, err)
continue