Pull request 2230: home: incr timeout

Updates #7041.

Squashed commit of the following:

commit 536382cf55bd158f179aaeabb1a16ed86d437257
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Jun 4 20:56:56 2024 +0300

    home: incr timeout
This commit is contained in:
Ainar Garipov 2024-06-04 21:06:11 +03:00
parent b69890b8fe
commit 4392255d7e
3 changed files with 11 additions and 3 deletions

View file

@ -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.
-->

View file

@ -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
@ -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,

View file

@ -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.
@ -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 {