metrics/influxdb: fix time ticker leaks (#26507)

pull/26515/head
ucwong 2 years ago committed by GitHub
parent f2758a8dac
commit 297ec0669d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      metrics/influxdb/influxdb.go
  2. 3
      metrics/influxdb/influxdbv2.go

@ -101,6 +101,9 @@ func (r *reporter) run() {
intervalTicker := time.NewTicker(r.interval)
pingTicker := time.NewTicker(time.Second * 5)
defer intervalTicker.Stop()
defer pingTicker.Stop()
for {
select {
case <-intervalTicker.C:

@ -62,6 +62,9 @@ func (r *v2Reporter) run() {
intervalTicker := time.NewTicker(r.interval)
pingTicker := time.NewTicker(time.Second * 5)
defer intervalTicker.Stop()
defer pingTicker.Stop()
for {
select {
case <-intervalTicker.C:

Loading…
Cancel
Save