-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Description
I'm trying to gracefully exit the webServer with a GET or POST to the the webServer itself.
Is there a way to execute code after a HTTP response has been given to the client to help me do that properly ?
Is there a nicer way to handle shutting down suave server from a CD pipeline ?
let app =
choose [
path "/gracefulExit" >=>
request(fun r ->
fun () ->
Threading.Thread.Sleep(1000)
Log.Information("graceful exit...")
cancellationTokenSource.Cancel()
|> doAsyncTask |> Async.Start
OK "Initiating graceful exit"
)]
njlr