Don't duplicate wait-for-shutdowns

This commit is contained in:
Neil Alexander 2022-04-27 15:34:56 +01:00
parent 1b9084744c
commit 6fe1ac2c9e
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -469,14 +469,12 @@ func (b *BaseDendrite) SetupAndServeHTTP(
} }
minwinsvc.SetOnExit(b.ProcessContext.ShutdownDendrite) minwinsvc.SetOnExit(b.ProcessContext.ShutdownDendrite)
<-b.ProcessContext.WaitForShutdown() <-b.ProcessContext.WaitForShutdown()
logrus.Infof("Stopping HTTP listeners") logrus.Infof("Stopping HTTP listeners")
_ = internalServ.Shutdown(context.Background()) _ = internalServ.Shutdown(context.Background())
_ = externalServ.Shutdown(context.Background()) _ = externalServ.Shutdown(context.Background())
logrus.Infof("Stopped HTTP listeners") logrus.Infof("Stopped HTTP listeners")
b.WaitForShutdown()
} }
func (b *BaseDendrite) WaitForShutdown() { func (b *BaseDendrite) WaitForShutdown() {