mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 01:03:10 -06:00
Update gobind-pinecone
This commit is contained in:
parent
cb73e6e550
commit
9ba2aa01f9
|
|
@ -71,8 +71,8 @@ func (m *DendriteMonolith) BaseURL() string {
|
||||||
return fmt.Sprintf("http://%s", m.listener.Addr().String())
|
return fmt.Sprintf("http://%s", m.listener.Addr().String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) PeerCount() int {
|
func (m *DendriteMonolith) PeerCount(peertype int) int {
|
||||||
return m.PineconeRouter.PeerCount()
|
return m.PineconeRouter.PeerCount(peertype)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) SessionCount() int {
|
func (m *DendriteMonolith) SessionCount() int {
|
||||||
|
|
@ -250,34 +250,6 @@ func (m *DendriteMonolith) Start() {
|
||||||
m.PineconeQUIC = pineconeSessions.NewQUIC(logger, m.PineconeRouter)
|
m.PineconeQUIC = pineconeSessions.NewQUIC(logger, m.PineconeRouter)
|
||||||
m.PineconeMulticast = pineconeMulticast.NewMulticast(logger, m.PineconeRouter)
|
m.PineconeMulticast = pineconeMulticast.NewMulticast(logger, m.PineconeRouter)
|
||||||
|
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
select {
|
|
||||||
case <-m.processContext.Context().Done():
|
|
||||||
return
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
if m.PineconeRouter == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
m.staticPeerMutex.RLock()
|
|
||||||
if m.staticPeerURI != "" {
|
|
||||||
found := false
|
|
||||||
for _, p := range m.PineconeRouter.Peers() {
|
|
||||||
if p.PeerType == pineconeRouter.PeerTypeRemote {
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
conn.ConnectToPeer(m.PineconeRouter, m.staticPeerURI)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.staticPeerMutex.RUnlock()
|
|
||||||
time.Sleep(time.Second * 5)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
cfg := &config.Dendrite{}
|
cfg := &config.Dendrite{}
|
||||||
cfg.Defaults()
|
cfg.Defaults()
|
||||||
cfg.Global.ServerName = gomatrixserverlib.ServerName(hex.EncodeToString(pk))
|
cfg.Global.ServerName = gomatrixserverlib.ServerName(hex.EncodeToString(pk))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue