try to reconnect even if the first connection failed.

This commit is contained in:
fiatjaf
2025-10-22 07:52:08 -03:00
parent 6ee0d090e3
commit dd097470d2

View File

@@ -422,7 +422,6 @@ func (pool *Pool) subMany(
}
eosed := atomic.Bool{}
firstConnection := true
go func(nm string) {
defer func() {
@@ -459,17 +458,10 @@ func (pool *Pool) subMany(
relay, err := pool.EnsureRelay(nm)
if err != nil {
// if we never connected to this just fail
if firstConnection {
debugLogf("[pool] connection to %s failed, won't retry as it was the first attempt\n", nm)
return
}
// otherwise (if we were connected and got disconnected) keep trying to reconnect
debugLogf("[pool] connection to %s failed, will retry\n", nm)
goto reconnect
}
firstConnection = false
hasAuthed = false
subscribe: