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