Skip to content

Commit

Permalink
adjust config default timeouts and improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Oct 10, 2019
1 parent bbc2814 commit 965720d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ type Config struct {
// NewRelicKey let it blank to disable newrelic
NewRelicKey string `env:"NEWRELIC_KEY" envDefault:""`

IdleTimeout time.Duration `env:"IDLE_TIMEOUT" envDefault:"5s"`
WriteTimeout time.Duration `env:"WRITE_TIMEOUT" envDefault:"3s"`
// RequestTimeout the timeout for the incoming request
RequestTimeout time.Duration `env:"REQUEST_TIMEOUT" envDefault:"5s"`
ReadHeaderTimeout time.Duration `env:"READ_HEADER_TIMEOUT" envDefault:"2s"`
IdleTimeout time.Duration `env:"IDLE_TIMEOUT" envDefault:"5s"`
// WriteTimeout maximum time the server will handle a request before timing out writes of the response.
// It must be bigger than RequestTimeout
WriteTimeout time.Duration `env:"WRITE_TIMEOUT" envDefault:"4s"`
// RequestTimeout the timeout for the incoming request set on the request handler
RequestTimeout time.Duration `env:"REQUEST_TIMEOUT" envDefault:"2s"`
ReadHeaderTimeout time.Duration `env:"READ_HEADER_TIMEOUT" envDefault:"1s"`

// ShutdownTimeout the time the sever will wait server.Shutdown to return
ShutdownTimeout time.Duration `env:"SHUTDOWN_TIMEOUT" envDefault:"6s"`
Expand Down

0 comments on commit 965720d

Please sign in to comment.