Switch pinecone demo to use new TotalPeerCount for clarity

This commit is contained in:
Devon Hudson 2023-01-11 11:56:37 -07:00
parent b8bb0395c5
commit 3b3e235969
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628
4 changed files with 5 additions and 5 deletions

View file

@ -478,7 +478,7 @@ func (m *DendriteMonolith) Start() {
go relayRetriever.SyncRelayServers(stopRelayServerSync) go relayRetriever.SyncRelayServers(stopRelayServerSync)
} }
case pineconeEvents.PeerRemoved: case pineconeEvents.PeerRemoved:
if relayRetriever.running.Load() && m.PineconeRouter.PeerCount(-1) == 0 { if relayRetriever.running.Load() && m.PineconeRouter.TotalPeerCount() == 0 {
stopRelayServerSync <- true stopRelayServerSync <- true
} }
case pineconeEvents.BroadcastReceived: case pineconeEvents.BroadcastReceived:

View file

@ -347,7 +347,7 @@ func main() {
go m.syncRelayServers(stopRelayServerSync, *relayServerSyncRunning) go m.syncRelayServers(stopRelayServerSync, *relayServerSyncRunning)
} }
case pineconeEvents.PeerRemoved: case pineconeEvents.PeerRemoved:
if relayServerSyncRunning.Load() && pRouter.PeerCount(-1) == 0 { if relayServerSyncRunning.Load() && pRouter.TotalPeerCount() == 0 {
stopRelayServerSync <- true stopRelayServerSync <- true
} }
case pineconeEvents.BroadcastReceived: case pineconeEvents.BroadcastReceived:

2
go.mod
View file

@ -23,7 +23,7 @@ require (
github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91 github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530
github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0 github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0
github.com/matrix-org/pinecone v0.0.0-20221118192051-fef26631b847 github.com/matrix-org/pinecone v0.11.1-0.20230111184901-61850f0e63cb
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 github.com/matrix-org/util v0.0.0-20221111132719-399730281e66
github.com/mattn/go-sqlite3 v1.14.15 github.com/mattn/go-sqlite3 v1.14.15
github.com/nats-io/nats-server/v2 v2.9.8 github.com/nats-io/nats-server/v2 v2.9.8

4
go.sum
View file

@ -350,8 +350,8 @@ github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 h1:kHKxCOLcHH8
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s=
github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0 h1:QCubFD4IoZxNUAI7+cCwZTRd0tB5Q7CBQpmxxHiUyUI= github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0 h1:QCubFD4IoZxNUAI7+cCwZTRd0tB5Q7CBQpmxxHiUyUI=
github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/gomatrixserverlib v0.0.0-20221219190859-e5bff01573e0/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4=
github.com/matrix-org/pinecone v0.0.0-20221118192051-fef26631b847 h1:auIBCi7gfZuvztD0aPr1G/J5Ya5vWr79M/+TJqwD/JM= github.com/matrix-org/pinecone v0.11.1-0.20230111184901-61850f0e63cb h1:2L+ltfNKab56FoBBqAvbBLjoAbxwwoZie+B8d+Mp3JI=
github.com/matrix-org/pinecone v0.0.0-20221118192051-fef26631b847/go.mod h1:F3GHppRuHCTDeoOmmgjZMeJdbql91+RSGGsATWfC7oc= github.com/matrix-org/pinecone v0.11.1-0.20230111184901-61850f0e63cb/go.mod h1:F3GHppRuHCTDeoOmmgjZMeJdbql91+RSGGsATWfC7oc=
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y= github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y=
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66/go.mod h1:iBI1foelCqA09JJgPV0FYz4qA5dUXYOxMi57FxKBdd4= github.com/matrix-org/util v0.0.0-20221111132719-399730281e66/go.mod h1:iBI1foelCqA09JJgPV0FYz4qA5dUXYOxMi57FxKBdd4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=