Don't deadlock after checking relay client status (fixes #2404)

This commit is contained in:
Jakob Borg 2015-10-22 20:32:15 +02:00
parent a32ac62208
commit f3dc78d457

View File

@ -170,12 +170,13 @@ func (s *Svc) RelayStatus(uri string) (time.Duration, bool) {
}
s.mut.RLock()
defer s.mut.RUnlock()
for _, client := range s.clients {
if client.URI().String() == uri {
return client.Latency(), client.StatusOK()
}
}
s.mut.RUnlock()
return time.Hour, false
}