Add configurable HTTP read and write timeouts

This commit is contained in:
Cooper Lees
2014-09-02 22:15:21 -07:00
parent 0f0296be1e
commit 67df033c7f
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -118,12 +118,14 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
glog.V(0).Info("Starting on ", cfg.Addr)
grace := graceful.Server{
grace := &graceful.Server{
Timeout: cfg.RequestTimeout.Duration,
ConnState: srv.connState,
Server: &http.Server{
Addr: cfg.Addr,
Handler: newRouter(srv),
ReadTimeout: cfg.HttpReadTimeout.Duration,
WriteTimeout: cfg.HttpWriteTimeout.Duration,
},
}