Commit f701c610 by Marcus Efraimsson Committed by GitHub

Merge pull request #15054 from RangerRick/master

add global datasource proxy timeout setting
parents 8510f0cd 9108fd1b
......@@ -159,6 +159,9 @@ conn_max_lifetime = 14400
# This enables data proxy logging, default is false
logging = false
# How long the data proxy should wait before timing out default is 30 (seconds)
timeout = 30
#################################### Analytics ###########################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
......
......@@ -146,6 +146,9 @@ log_queries =
# This enables data proxy logging, default is false
;logging = false
# How long the data proxy should wait before timing out default is 30 (seconds)
;timeout = 30
#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
......
......@@ -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
......@@ -597,6 +598,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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment