mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
revert ds_proxy timeout and implement dataproxy timeout correctly
This commit is contained in:
parent
1b22ceabbe
commit
a1cd550df4
@ -54,7 +54,7 @@ func NewDataSourceProxy(ds *m.DataSource, plugin *plugins.DataSourcePlugin, ctx
|
|||||||
|
|
||||||
func newHTTPClient() httpClient {
|
func newHTTPClient() httpClient {
|
||||||
return &http.Client{
|
return &http.Client{
|
||||||
Timeout: time.Duration(setting.DataProxyTimeout) * time.Second,
|
Timeout: 30 * time.Second,
|
||||||
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
|
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
type proxyTransportCache struct {
|
type proxyTransportCache struct {
|
||||||
@ -57,7 +59,7 @@ func (ds *DataSource) GetHttpTransport() (*http.Transport, error) {
|
|||||||
TLSClientConfig: tlsConfig,
|
TLSClientConfig: tlsConfig,
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
Dial: (&net.Dialer{
|
Dial: (&net.Dialer{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: time.Duration(setting.DataProxyTimeout) * time.Second,
|
||||||
KeepAlive: 30 * time.Second,
|
KeepAlive: 30 * time.Second,
|
||||||
DualStack: true,
|
DualStack: true,
|
||||||
}).Dial,
|
}).Dial,
|
||||||
|
Loading…
Reference in New Issue
Block a user