Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    rmulley
    @rmulley
    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?
    Tyler Stillwater
    @tylerb
    @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.
    Jimmy Zelinskie
    @jzelinskie
    @tylerb is doing something like this the best way to block until the server has been shutdown? https://github.com/chihaya/chihaya/blob/33d6b1cd1277e68afe73e36770f555ff38b1d6d7/server/prometheus/prometheus.go#L86-L93
    Tyler Stillwater
    @tylerb
    @jzelinskie graceful will block for you. The stopchan is for other goroutines to be made aware that the server is stopping.
    Jimmy Zelinskie
    @jzelinskie
    @tylerb so I only need to call s.grace.Stop(timeout)?
    Tyler Stillwater
    @tylerb
    @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.
    Gerasimos (Makis) Maropoulos
    @removed~kataras
    @tylerb Tyler
    Are you ok with the fact that I added your package to Iris' thirdparty example and on README thirdparty middlewares page ? https://github.com/kataras/iris/tree/master/_examples/thirdparty_graceful and https://github.com/kataras/iris#third-party-middleware
    If you have any problem with that, inform me please, good job!
    Tyler Stillwater
    @tylerb
    @kataras of course! Thank you for including graceful!
    Gerasimos (Makis) Maropoulos
    @removed~kataras
    It's very good package my friend, it worths it good job again !