mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-29 17:51:56 -06:00
Avoid panicking unnecessarily when shutting down the gobind
P2P demos (#2520)
This commit is contained in:
parent
0d7020fbaf
commit
aafb7bf120
|
@ -261,7 +261,7 @@ func (m *DendriteMonolith) Start() {
|
||||||
cfg.MSCs.MSCs = []string{"msc2836", "msc2946"}
|
cfg.MSCs.MSCs = []string{"msc2836", "msc2946"}
|
||||||
cfg.ClientAPI.RegistrationDisabled = false
|
cfg.ClientAPI.RegistrationDisabled = false
|
||||||
cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled = true
|
cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled = true
|
||||||
if err := cfg.Derive(); err != nil {
|
if err = cfg.Derive(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,11 +342,23 @@ func (m *DendriteMonolith) Start() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
m.logger.Info("Listening on ", cfg.Global.ServerName)
|
m.logger.Info("Listening on ", cfg.Global.ServerName)
|
||||||
m.logger.Fatal(m.httpServer.Serve(m.PineconeQUIC.Protocol("matrix")))
|
|
||||||
|
switch m.httpServer.Serve(m.PineconeQUIC.Protocol("matrix")) {
|
||||||
|
case net.ErrClosed, http.ErrServerClosed:
|
||||||
|
m.logger.Info("Stopped listening on ", cfg.Global.ServerName)
|
||||||
|
default:
|
||||||
|
m.logger.Fatal(err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
logrus.Info("Listening on ", m.listener.Addr())
|
logrus.Info("Listening on ", m.listener.Addr())
|
||||||
logrus.Fatal(http.Serve(m.listener, httpRouter))
|
|
||||||
|
switch http.Serve(m.listener, httpRouter) {
|
||||||
|
case net.ErrClosed, http.ErrServerClosed:
|
||||||
|
m.logger.Info("Stopped listening on ", cfg.Global.ServerName)
|
||||||
|
default:
|
||||||
|
m.logger.Fatal(err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,11 +170,11 @@ func (m *DendriteMonolith) Start() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
m.logger.Info("Listening on ", ygg.DerivedServerName())
|
m.logger.Info("Listening on ", ygg.DerivedServerName())
|
||||||
m.logger.Fatal(m.httpServer.Serve(ygg))
|
m.logger.Error(m.httpServer.Serve(ygg))
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
logrus.Info("Listening on ", m.listener.Addr())
|
logrus.Info("Listening on ", m.listener.Addr())
|
||||||
logrus.Fatal(http.Serve(m.listener, httpRouter))
|
logrus.Error(http.Serve(m.listener, httpRouter))
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
logrus.Info("Sending wake-up message to known nodes")
|
logrus.Info("Sending wake-up message to known nodes")
|
||||||
|
|
Loading…
Reference in a new issue