mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-22 22:31:56 -06:00
Fixes for multiple Pinecone peers
This commit is contained in:
parent
310edd737c
commit
11f588b0d6
|
@ -76,7 +76,7 @@ func (m *DendriteMonolith) BaseURL() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) PeerCount(peertype int) int {
|
func (m *DendriteMonolith) PeerCount(peertype int) int {
|
||||||
return m.PineconeRouter.PeerCount(pineconeRouter.ConnectionPeerType(peertype))
|
return m.PineconeRouter.PeerCount(peertype)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) SessionCount() int {
|
func (m *DendriteMonolith) SessionCount() int {
|
||||||
|
@ -209,7 +209,7 @@ func (m *DendriteMonolith) staticPeerConnect() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for k := range connected {
|
for k := range connected {
|
||||||
connected[k] = false
|
delete(connected, k)
|
||||||
}
|
}
|
||||||
for _, uri := range strings.Split(uri, ",") {
|
for _, uri := range strings.Split(uri, ",") {
|
||||||
connected[strings.TrimSpace(uri)] = false
|
connected[strings.TrimSpace(uri)] = false
|
||||||
|
@ -289,7 +289,7 @@ func (m *DendriteMonolith) Start() {
|
||||||
cfg.SyncAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-syncapi.db", m.StorageDirectory, prefix))
|
cfg.SyncAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-syncapi.db", m.StorageDirectory, prefix))
|
||||||
cfg.RoomServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-roomserver.db", m.StorageDirectory, prefix))
|
cfg.RoomServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-roomserver.db", m.StorageDirectory, prefix))
|
||||||
cfg.KeyServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-keyserver.db", m.StorageDirectory, prefix))
|
cfg.KeyServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-keyserver.db", m.StorageDirectory, prefix))
|
||||||
cfg.FederationAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-federationapi.db", m.StorageDirectory, prefix))
|
cfg.FederationAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-federationsender.db", m.StorageDirectory, prefix))
|
||||||
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-appservice.db", m.StorageDirectory, prefix))
|
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/%s-appservice.db", m.StorageDirectory, prefix))
|
||||||
cfg.MediaAPI.BasePath = config.Path(fmt.Sprintf("%s/media", m.CacheDirectory))
|
cfg.MediaAPI.BasePath = config.Path(fmt.Sprintf("%s/media", m.CacheDirectory))
|
||||||
cfg.MediaAPI.AbsBasePath = config.Path(fmt.Sprintf("%s/media", m.CacheDirectory))
|
cfg.MediaAPI.AbsBasePath = config.Path(fmt.Sprintf("%s/media", m.CacheDirectory))
|
||||||
|
|
|
@ -94,7 +94,7 @@ func (m *DendriteMonolith) Start() {
|
||||||
cfg.SyncAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-syncapi.db", m.StorageDirectory))
|
cfg.SyncAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-syncapi.db", m.StorageDirectory))
|
||||||
cfg.RoomServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-roomserver.db", m.StorageDirectory))
|
cfg.RoomServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-roomserver.db", m.StorageDirectory))
|
||||||
cfg.KeyServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-keyserver.db", m.StorageDirectory))
|
cfg.KeyServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-keyserver.db", m.StorageDirectory))
|
||||||
cfg.FederationAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-federationapi.db", m.StorageDirectory))
|
cfg.FederationAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-federationsender.db", m.StorageDirectory))
|
||||||
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-appservice.db", m.StorageDirectory))
|
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s/dendrite-p2p-appservice.db", m.StorageDirectory))
|
||||||
cfg.MediaAPI.BasePath = config.Path(fmt.Sprintf("%s/tmp", m.StorageDirectory))
|
cfg.MediaAPI.BasePath = config.Path(fmt.Sprintf("%s/tmp", m.StorageDirectory))
|
||||||
cfg.MediaAPI.AbsBasePath = config.Path(fmt.Sprintf("%s/tmp", m.StorageDirectory))
|
cfg.MediaAPI.AbsBasePath = config.Path(fmt.Sprintf("%s/tmp", m.StorageDirectory))
|
||||||
|
|
|
@ -37,7 +37,7 @@ func ConnectToPeer(pRouter *pineconeRouter.Router, peer string) error {
|
||||||
_, err := pRouter.Connect(
|
_, err := pRouter.Connect(
|
||||||
parent,
|
parent,
|
||||||
pineconeRouter.ConnectionZone("static"),
|
pineconeRouter.ConnectionZone("static"),
|
||||||
pineconeRouter.PeerTypeRemote,
|
pineconeRouter.ConnectionPeerType(pineconeRouter.PeerTypeRemote),
|
||||||
pineconeRouter.ConnectionURI(peer),
|
pineconeRouter.ConnectionURI(peer),
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -110,7 +110,10 @@ func main() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
port, err := pRouter.Connect(conn, pineconeRouter.PeerTypeRemote)
|
port, err := pRouter.Connect(
|
||||||
|
conn,
|
||||||
|
pineconeRouter.ConnectionPeerType(pineconeRouter.PeerTypeRemote),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Error("pSwitch.Connect failed")
|
logrus.WithError(err).Error("pSwitch.Connect failed")
|
||||||
continue
|
continue
|
||||||
|
@ -242,7 +245,7 @@ func main() {
|
||||||
if _, err = pRouter.Connect(
|
if _, err = pRouter.Connect(
|
||||||
conn,
|
conn,
|
||||||
pineconeRouter.ConnectionZone("websocket"),
|
pineconeRouter.ConnectionZone("websocket"),
|
||||||
pineconeRouter.PeerTypeRemote,
|
pineconeRouter.ConnectionPeerType(pineconeRouter.PeerTypeRemote),
|
||||||
); err != nil {
|
); err != nil {
|
||||||
logrus.WithError(err).Error("Failed to connect WebSocket peer to Pinecone switch")
|
logrus.WithError(err).Error("Failed to connect WebSocket peer to Pinecone switch")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue