try to reconnect even if the first connection failed.
This commit is contained in:
8
pool.go
8
pool.go
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user