This is an automated email from the ASF dual-hosted git repository.

zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new c1fe45d6d5 Log errors in Traffic Stats when closing influxdb client 
(#6919)
c1fe45d6d5 is described below

commit c1fe45d6d51d4e86d86dc9a273f6bf7e8e4647b7
Author: Rawlin Peters <[email protected]>
AuthorDate: Thu Jun 23 09:43:10 2022 -0600

    Log errors in Traffic Stats when closing influxdb client (#6919)
---
 traffic_stats/traffic_stats.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/traffic_stats/traffic_stats.go b/traffic_stats/traffic_stats.go
index 6caa1f7542..65385dbf8a 100644
--- a/traffic_stats/traffic_stats.go
+++ b/traffic_stats/traffic_stats.go
@@ -555,7 +555,9 @@ func loadStartupConfig(configFile string, oldConfig 
StartupConfig) (StartupConfi
        //Close old connections explicitly
        for _, host := range oldConfig.InfluxDBs {
                if host.InfluxClient != nil {
-                       host.InfluxClient.Close()
+                       if err := host.InfluxClient.Close(); err != nil {
+                               errorf("closing influx client: %s", err)
+                       }
                }
        }
 
@@ -1063,7 +1065,9 @@ func influxConnect(config StartupConfig) (influx.Client, 
error) {
                }
                //Close old connections explicitly
                if host.InfluxClient != nil {
-                       host.InfluxClient.Close()
+                       if err := host.InfluxClient.Close(); err != nil {
+                               errorf("closing influx client: %s", err)
+                       }
                }
                host.InfluxClient = con
                _, _, err = con.Ping(10)

Reply via email to