sets req r&w timeouts to 10s

This commit is contained in:
Christian Müller
2017-09-21 02:04:13 +02:00
parent 1f867a8208
commit cb8891fd5b
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -4,3 +4,4 @@ database.sqlite-journal
.DS_Store .DS_Store
vendor vendor
database.sqlite database.sqlite
notehub
+7 -1
View File
@@ -9,6 +9,7 @@ import (
"net/http" "net/http"
"os" "os"
"sync" "sync"
"time"
"database/sql" "database/sql"
@@ -162,7 +163,12 @@ func main() {
return c.NoContent(http.StatusNoContent) return c.NoContent(http.StatusNoContent)
}) })
e.Logger.Fatal(e.Start(":3000")) s := &http.Server{
Addr: ":3000",
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
}
e.Logger.Fatal(e.StartServer(s))
} }
func fraudelent(n *Note) bool { func fraudelent(n *Note) bool {