better logs
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 28s
Build and Publish / BuildAndDeploy (push) Successful in 2m18s

This commit is contained in:
matst80
2024-11-13 10:25:08 +01:00
parent 589a7c159b
commit fc25119a1a

View File

@@ -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