better logs
This commit is contained in:
@@ -29,6 +29,10 @@ func (d *DiscardedHostHandler) run() {
|
|||||||
if host.Tries >= 0 || host.Tries < 5 {
|
if host.Tries >= 0 || host.Tries < 5 {
|
||||||
go d.testConnection(host)
|
go d.testConnection(host)
|
||||||
lst = append(lst, 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()
|
d.mu.RUnlock()
|
||||||
@@ -71,7 +75,7 @@ func (d *DiscardedHostHandler) SetReconnectHandler(fn func(string)) {
|
|||||||
func (d *DiscardedHostHandler) AppendHost(host string) {
|
func (d *DiscardedHostHandler) AppendHost(host string) {
|
||||||
d.mu.Lock()
|
d.mu.Lock()
|
||||||
defer d.mu.Unlock()
|
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{
|
d.hosts = append(d.hosts, &DiscardedHost{
|
||||||
Host: host,
|
Host: host,
|
||||||
Tries: 0,
|
Tries: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user