mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Close database connections last on shutdown (#11683)
The job workers and cluster discovery components require access to the database during shutdown. To avoid issues, we leave the database open until the last step of the shutdown process.
This commit is contained in:
committed by
George Goldberg
parent
fe8a0f6485
commit
f4ef9cab5b
@@ -332,10 +332,6 @@ func (s *Server) Shutdown() error {
|
||||
s.StopHTTPServer()
|
||||
s.WaitForGoroutines()
|
||||
|
||||
if s.Store != nil {
|
||||
s.Store.Close()
|
||||
}
|
||||
|
||||
if s.htmlTemplateWatcher != nil {
|
||||
s.htmlTemplateWatcher.Close()
|
||||
}
|
||||
@@ -358,6 +354,10 @@ func (s *Server) Shutdown() error {
|
||||
s.Jobs.StopSchedulers()
|
||||
}
|
||||
|
||||
if s.Store != nil {
|
||||
s.Store.Close()
|
||||
}
|
||||
|
||||
mlog.Info("Server stopped")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user