mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 21:32:46 +00:00
Tweaks to pinecone demo to shutdown more cleanly
This commit is contained in:
parent
3d31b131fc
commit
b28406c7d0
3 changed files with 62 additions and 28 deletions
|
@ -38,7 +38,7 @@ type RelayServerRetriever struct {
|
|||
relayServersQueried map[gomatrixserverlib.ServerName]bool
|
||||
queriedServersMutex sync.Mutex
|
||||
running atomic.Bool
|
||||
quit <-chan bool
|
||||
quit chan bool
|
||||
}
|
||||
|
||||
func NewRelayServerRetriever(
|
||||
|
@ -46,7 +46,7 @@ func NewRelayServerRetriever(
|
|||
serverName gomatrixserverlib.ServerName,
|
||||
federationAPI federationAPI.FederationInternalAPI,
|
||||
relayAPI relayServerAPI.RelayInternalAPI,
|
||||
quit <-chan bool,
|
||||
quit chan bool,
|
||||
) RelayServerRetriever {
|
||||
return RelayServerRetriever{
|
||||
ctx: ctx,
|
||||
|
@ -151,6 +151,7 @@ func (r *RelayServerRetriever) SyncRelayServers(stop <-chan bool) {
|
|||
if !t.Stop() {
|
||||
<-t.C
|
||||
}
|
||||
logrus.Info("Stopped relay server retriever")
|
||||
return
|
||||
case <-t.C:
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ func TestRelayRetrieverInitialization(t *testing.T) {
|
|||
"server",
|
||||
&FakeFedAPI{},
|
||||
&FakeRelayAPI{},
|
||||
make(<-chan bool),
|
||||
make(chan bool),
|
||||
)
|
||||
|
||||
retriever.InitializeRelayServers(logrus.WithField("test", "relay"))
|
||||
|
@ -74,7 +74,7 @@ func TestRelayRetrieverSync(t *testing.T) {
|
|||
"server",
|
||||
&FakeFedAPI{},
|
||||
&FakeRelayAPI{},
|
||||
make(<-chan bool),
|
||||
make(chan bool),
|
||||
)
|
||||
|
||||
retriever.InitializeRelayServers(logrus.WithField("test", "relay"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue