mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-30 02:58:10 -07:00
Add configurable HTTP read and write timeouts
This commit is contained in:
+3
-1
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user