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 {
|
||||
parent, err := net.Dial("tcp", uri)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to connect to Pinecone static peer")
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
parent, err := net.Dial("tcp", uri)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to connect to Pinecone static peer")
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := m.PineconeSwitch.Connect(parent); err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
||||
return err
|
||||
}
|
||||
if _, err := m.PineconeSwitch.AuthenticatedConnect(parent, "static"); err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to connect Pinecone static peer to switch")
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -150,7 +152,7 @@ func (m *DendriteMonolith) Start() {
|
|||
rL, rR := net.Pipe()
|
||||
m.PineconeSwitch = pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ func main() {
|
|||
rL, rR := net.Pipe()
|
||||
pSwitch := pineconeSwitch.NewSwitch(logger, sk, pk, false)
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ func main() {
|
|||
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")
|
||||
}
|
||||
}(*instancePeer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue