mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 01:45:44 +03:00
Merge pull request #7704 from hashicorp/b-agent-shutdown-order
agent: shutdown agent http server last
This commit is contained in:
@@ -640,10 +640,12 @@ func (c *Command) Run(args []string) int {
|
||||
logGate.Flush()
|
||||
return 1
|
||||
}
|
||||
defer c.agent.Shutdown()
|
||||
|
||||
// Shutdown the HTTP server at the end
|
||||
defer func() {
|
||||
c.agent.Shutdown()
|
||||
|
||||
// Shutdown the http server at the end, to ease debugging if
|
||||
// the agent takes long to shutdown
|
||||
if c.httpServer != nil {
|
||||
c.httpServer.Shutdown()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user