Graceful is a Go package enabling graceful shutdown of an http.Handler server.
Hey I'm using Graceful with Negroni, however existing requests are being killed before responding. It appears like a hard shutdown.
Is there anything else besides graceful.Run(":3001",10*time.Second,n) that I need to add?
Or is there anyway to customize what happens during the graceful shutdown?
@rmulley that is all that should be required. I'm not sure why your existing connections are being killed. You can take a look at setting the ConnState var in the Server struct to get callbacks about the state of each connection.
@jzelinskie graceful will block for you. The stopchan is for other goroutines to be made aware that the server is stopping.
@tylerb so I only need to call s.grace.Stop(timeout)?
@jzelinskie You only need to call that if you want to explicitly stop your server from a POST /stop call or something like that. Otherwise, graceful handles stopping for you by catching signals like interrupt and kill.