mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Tweaks
This commit is contained in:
parent
b075d167f8
commit
21c62ff489
|
|
@ -68,16 +68,18 @@ func (m *DendriteMonolith) SetMulticastEnabled(enabled bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) SetStaticPeer(uri string) error {
|
func (m *DendriteMonolith) SetStaticPeer(uri string) error {
|
||||||
|
go func() {
|
||||||
parent, err := net.Dial("tcp", uri)
|
parent, err := net.Dial("tcp", uri)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to connect to Pinecone static peer")
|
logrus.WithError(err).Errorf("Failed to connect to Pinecone static peer")
|
||||||
return err
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := m.PineconeSwitch.Connect(parent); err != nil {
|
if _, err := m.PineconeSwitch.AuthenticatedConnect(parent, "static"); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
||||||
return err
|
return
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +152,7 @@ func (m *DendriteMonolith) Start() {
|
||||||
rL, rR := net.Pipe()
|
rL, rR := net.Pipe()
|
||||||
m.PineconeSwitch = pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
m.PineconeSwitch = pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
||||||
m.PineconeRouter = pineconeRouter.NewRouter(logger, sk, pk, rL, "router", nil)
|
m.PineconeRouter = pineconeRouter.NewRouter(logger, sk, pk, rL, "router", nil)
|
||||||
if _, err := m.PineconeSwitch.Connect(rR); err != nil {
|
if _, err := m.PineconeSwitch.Connect(rR, nil, ""); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ func main() {
|
||||||
rL, rR := net.Pipe()
|
rL, rR := net.Pipe()
|
||||||
pSwitch := pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
pSwitch := pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
||||||
pRouter := pineconeRouter.NewRouter(logger, sk, pk, rL, "router", nil)
|
pRouter := pineconeRouter.NewRouter(logger, sk, pk, rL, "router", nil)
|
||||||
if _, err := pSwitch.Connect(rR); err != nil {
|
if _, err := pSwitch.Connect(rR, nil, ""); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := pSwitch.Connect(parent); err != nil {
|
if _, err := pSwitch.Connect(parent, nil, "static"); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
||||||
}
|
}
|
||||||
}(*instancePeer)
|
}(*instancePeer)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue