slaskit
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 28s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s

This commit is contained in:
matst80
2024-11-13 08:58:40 +01:00
parent c9a7113e12
commit 3615d2d7d1
4 changed files with 19 additions and 4 deletions

View File

@@ -57,6 +57,7 @@ func (m *PersistentConnection) Connect() error {
if !m.Dead {
connection, err := net.Dial("tcp", m.address)
if err != nil {
log.Printf("Error connecting to %s: %v\n", m.address, err)
m.Died <- true
m.Dead = true
return err
@@ -74,6 +75,7 @@ func (m *PersistentConnection) Close() {
func (m *PersistentConnection) HandleConnectionError(err error) error {
if err != nil {
log.Printf("Error from to %s: %v\n", m.address, err)
m.Conn.Close()
m.Connect()
}