app/server: shutdown producst before closing the store (#20159)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d779294d01
Коммит
3f921bf170
@@ -1039,6 +1039,15 @@ func (s *Server) Shutdown() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop products.
|
||||||
|
// This needs to happen last because products are dependent
|
||||||
|
// on parent services.
|
||||||
|
for name, product := range s.products {
|
||||||
|
if err2 := product.Stop(); err2 != nil {
|
||||||
|
mlog.Warn("Unable to cleanly stop product", mlog.String("name", name), mlog.Err(err2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if s.Store != nil {
|
if s.Store != nil {
|
||||||
s.Store.Close()
|
s.Store.Close()
|
||||||
}
|
}
|
||||||
@@ -1051,15 +1060,6 @@ func (s *Server) Shutdown() {
|
|||||||
|
|
||||||
mlog.Info("Server stopped")
|
mlog.Info("Server stopped")
|
||||||
|
|
||||||
// Stop products.
|
|
||||||
// This needs to happen last because products are dependent
|
|
||||||
// on parent services.
|
|
||||||
for name, product := range s.products {
|
|
||||||
if err2 := product.Stop(); err2 != nil {
|
|
||||||
mlog.Warn("Unable to cleanly stop product", mlog.String("name", name), mlog.Err(err2))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// shutdown main and notification loggers which will flush any remaining log records.
|
// shutdown main and notification loggers which will flush any remaining log records.
|
||||||
timeoutCtx, timeoutCancel := context.WithTimeout(context.Background(), time.Second*15)
|
timeoutCtx, timeoutCancel := context.WithTimeout(context.Background(), time.Second*15)
|
||||||
defer timeoutCancel()
|
defer timeoutCancel()
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user