Merge pull request #7704 from hashicorp/b-agent-shutdown-order
agent: shutdown agent http server last
This commit is contained in:
commit
5b42796f1e
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue