From c8e002b5c468ff651df6f9f79497940ef002a5fd Mon Sep 17 00:00:00 2001 From: boyska Date: Mon, 25 Sep 2017 17:42:01 +0200 Subject: [PATCH] graceful stop not really tested --- cmd/megauploader/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/megauploader/main.go b/cmd/megauploader/main.go index 625b3ee..5e39bd6 100644 --- a/cmd/megauploader/main.go +++ b/cmd/megauploader/main.go @@ -5,6 +5,9 @@ import ( "fmt" "net/http" "os" + "time" + + "github.com/tylerb/graceful" "git.lattuga.net/boyska/megauploader" ) @@ -34,5 +37,5 @@ func main() { mu := megauploader.MegaUploader{Conf: cfg} mu.SetupRoutes() - http.ListenAndServe(*addr, nil) + graceful.Run(*addr, 15*time.Second, http.DefaultServeMux) }