mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Fix graceful shutdown
This commit is contained in:
parent
103795d33a
commit
923f789ca3
4 changed files with 33 additions and 21 deletions
|
@ -469,14 +469,14 @@ func (b *BaseDendrite) SetupAndServeHTTP(
|
|||
}
|
||||
|
||||
minwinsvc.SetOnExit(b.ProcessContext.ShutdownDendrite)
|
||||
b.WaitForShutdown()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
_ = internalServ.Shutdown(ctx)
|
||||
_ = externalServ.Shutdown(ctx)
|
||||
<-b.ProcessContext.WaitForShutdown()
|
||||
logrus.Infof("Stopping HTTP listeners")
|
||||
_ = internalServ.Shutdown(context.Background())
|
||||
_ = externalServ.Shutdown(context.Background())
|
||||
logrus.Infof("Stopped HTTP listeners")
|
||||
|
||||
b.WaitForShutdown()
|
||||
}
|
||||
|
||||
func (b *BaseDendrite) WaitForShutdown() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue