add global datasource proxy timeout setting
closes grafana#5699
This commit is contained in:
@@ -54,7 +54,7 @@ func NewDataSourceProxy(ds *m.DataSource, plugin *plugins.DataSourcePlugin, ctx
|
||||
|
||||
func newHTTPClient() httpClient {
|
||||
return &http.Client{
|
||||
Timeout: time.Second * 30,
|
||||
Timeout: time.Duration(setting.DataProxyTimeout) * time.Second,
|
||||
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ var (
|
||||
SocketPath string
|
||||
RouterLogging bool
|
||||
DataProxyLogging bool
|
||||
DataProxyTimeout int
|
||||
StaticRootPath string
|
||||
EnableGzip bool
|
||||
EnforceDomain bool
|
||||
@@ -583,6 +584,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
||||
// read data proxy settings
|
||||
dataproxy := iniFile.Section("dataproxy")
|
||||
DataProxyLogging = dataproxy.Key("logging").MustBool(false)
|
||||
DataProxyTimeout = dataproxy.Key("timeout").MustInt(30)
|
||||
|
||||
// read security settings
|
||||
security := iniFile.Section("security")
|
||||
|
||||
Reference in New Issue
Block a user