Skip to content

Commit

Permalink
home: incr timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Jun 4, 2024
1 parent b69890b commit 536382c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ See also the [v0.107.51 GitHub milestone][ms-v0.107.51].
NOTE: Add new changes BELOW THIS COMMENT.
-->

### Changed

- The HTTP server's write timeout has been increased from 1 minute to 5 minutes
to match the one used by AdGuard Home's HTTP client to fetch filtering-list
data ([#7041]).

[#7041]: https://github.com/AdguardTeam/AdGuardHome/issues/7041

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
-->
Expand Down
3 changes: 1 addition & 2 deletions internal/home/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net"
"net/http"
"net/url"
"time"
)

// httpClient returns a new HTTP client that uses the AdGuard Home's own DNS
Expand All @@ -23,7 +22,7 @@ func httpClient() (c *http.Client) {

return &http.Client{
// TODO(a.garipov): Make configurable.
Timeout: time.Minute * 5,
Timeout: writeTimeout,
Transport: &http.Transport{
DialContext: dialContext,
Proxy: httpProxy,
Expand Down
3 changes: 2 additions & 1 deletion internal/home/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"golang.org/x/net/http2/h2c"
)

// TODO(a.garipov): Make configurable.
const (
// readTimeout is the maximum duration for reading the entire request,
// including the body.
Expand All @@ -31,7 +32,7 @@ const (
readHdrTimeout = 60 * time.Second
// writeTimeout is the maximum duration before timing out writes of the
// response.
writeTimeout = 60 * time.Second
writeTimeout = 5 * time.Minute
)

type webConfig struct {
Expand Down

0 comments on commit 536382c

Please sign in to comment.