better logs
This commit is contained in:
@@ -29,6 +29,10 @@ func (d *DiscardedHostHandler) run() {
|
||||
if host.Tries >= 0 || host.Tries < 5 {
|
||||
go d.testConnection(host)
|
||||
lst = append(lst, host)
|
||||
} else {
|
||||
if host.Tries > 0 {
|
||||
log.Printf("Host %s discarded after %d tries", host.Host, host.Tries)
|
||||
}
|
||||
}
|
||||
}
|
||||
d.mu.RUnlock()
|
||||
@@ -71,7 +75,7 @@ func (d *DiscardedHostHandler) SetReconnectHandler(fn func(string)) {
|
||||
func (d *DiscardedHostHandler) AppendHost(host string) {
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
log.Printf("Retrying host %s", host)
|
||||
log.Printf("Adding host %s to retry list", host)
|
||||
d.hosts = append(d.hosts, &DiscardedHost{
|
||||
Host: host,
|
||||
Tries: 0,
|
||||
|
||||
Reference in New Issue
Block a user