1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-10 00:28:23 +02:00
echo/website/content/recipes/graceful-shutdown.md
Antonio Pagano ffdb76efc7 [doc] adding graceful documentation and example. (#688)
* [doc] adding graceful documentation and example.

* adding myself to the maintainers list and minor comment formatting change
2016-10-25 08:09:43 -07:00

862 B

+++ title = "Graceful Shutdown Recipe" description = "Graceful shutdown recipe / example for Echo" [menu.side] name = "Graceful Shutdown" parent = "recipes" weight = 13 +++

Graceful Shutdown Recipe

Echo now ships with graceful server termination inside it, to accomplish it Echo uses github.com/tylerb/graceful library.

By Default echo uses 15 seconds as shutdown timeout, giving 15 secs to open connections at the time the server starts to shut-down.

In order to change this default 15 seconds you could change the ShutdownTimeout property of your Echo instance as needed by doing something like:

server.go

{{< embed "graceful-shutdown/server.go" >}}

Maintainers

Source Code

  • [graceful]({{< source "graceful-shutdown/graceful" >}})