Fix sqlserver connection closing on error (#5897)
This commit is contained in:
committed by
Daniel Nelson
parent
6ed2b64b6c
commit
adc32002da
@@ -151,12 +151,6 @@ func (s *SQLServer) gatherServer(server string, query Query, acc telegraf.Accumu
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// verify that a connection can be made before making a query
|
||||
err = conn.Ping()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
// execute query
|
||||
|
||||
Reference in New Issue
Block a user