mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 22:33:23 +00:00
Update comments
- updates comments and adds where missing - updates locks so that unlock is done via defer instead of at the end of the statement - extracts timeout variable in two places - remove makeClient() unused method from metrics package No-harm changes tested via go build. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
@ -60,11 +60,14 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
func (e *Exporter) StartServiceWatcher(endpointURL url.URL, metricsOptions MetricOptions, label string, interval time.Duration) {
|
||||
ticker := time.NewTicker(interval)
|
||||
quit := make(chan struct{})
|
||||
|
||||
timeout := 3 * time.Second
|
||||
|
||||
proxyClient := http.Client{
|
||||
Transport: &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 3 * time.Second,
|
||||
Timeout: timeout,
|
||||
KeepAlive: 0,
|
||||
}).DialContext,
|
||||
MaxIdleConns: 1,
|
||||
|
Reference in New Issue
Block a user