graceful stop

not really tested
This commit is contained in:
boyska 2017-09-25 17:42:01 +02:00
parent c640ec47ac
commit c8e002b5c4

View file

@ -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)
}