better logs
This commit is contained in:
@@ -58,9 +58,10 @@ func (m *PersistentConnection) Connect() error {
|
||||
for {
|
||||
connection, err := net.Dial("tcp", m.address)
|
||||
if err != nil {
|
||||
log.Printf("Error connecting to %s: %v\n", m.address, err)
|
||||
log.Printf("Can't connect to %s: %v\n, count: %d", m.address, err, fails)
|
||||
fails++
|
||||
if fails > 15 {
|
||||
log.Printf("Too many connection failures, closing connection to %s\n", m.address)
|
||||
m.Died <- true
|
||||
m.Dead = true
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user