mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Setup tweaks
This commit is contained in:
parent
d64d859c96
commit
3f750a4fc2
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
|
@ -100,14 +101,23 @@ func (m *DendriteMonolith) DisconnectMulticastPeers() {
|
||||||
func (m *DendriteMonolith) Conduit(zone string) (*Conduit, error) {
|
func (m *DendriteMonolith) Conduit(zone string) (*Conduit, error) {
|
||||||
l, r := net.Pipe()
|
l, r := net.Pipe()
|
||||||
go func() {
|
go func() {
|
||||||
|
loop:
|
||||||
for i := 1; i <= 10; i++ {
|
for i := 1; i <= 10; i++ {
|
||||||
logrus.Errorf("Attempting authenticated connect (attempt %d)", i)
|
logrus.Errorf("Attempting authenticated connect (attempt %d)", i)
|
||||||
p, err := m.PineconeRouter.AuthenticatedConnect(l, zone)
|
p, err := m.PineconeRouter.AuthenticatedConnect(l, zone)
|
||||||
if err == nil {
|
switch err {
|
||||||
|
case io.ErrClosedPipe:
|
||||||
|
logrus.Errorf("Authenticated connect failed due to closed pipe (attempt %d)", i)
|
||||||
|
return
|
||||||
|
case io.EOF:
|
||||||
|
logrus.Errorf("Authenticated connect failed due to EOF (attempt %d)", i)
|
||||||
|
break loop
|
||||||
|
case nil:
|
||||||
logrus.Errorf("Authenticated connect succeeded, connected to port %d (attempt %d)", p, i)
|
logrus.Errorf("Authenticated connect succeeded, connected to port %d (attempt %d)", p, i)
|
||||||
return
|
return
|
||||||
|
default:
|
||||||
|
logrus.WithError(err).Errorf("Authenticated connect failed (attempt %d)", i)
|
||||||
}
|
}
|
||||||
logrus.WithError(err).Errorf("Authenticated connect failed (attempt %d)", i)
|
|
||||||
}
|
}
|
||||||
_ = l.Close()
|
_ = l.Close()
|
||||||
_ = r.Close()
|
_ = r.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue