Skip to content

Commit

Permalink
metrics/influxdb: replace time.Tick with time.NewTicker (ethereum#24783)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Dec 10, 2024
1 parent d52e538 commit 6c89882
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions metrics/influxdb/influxdbv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ func InfluxDBV2WithTags(r metrics.Registry, d time.Duration, endpoint string, to
}

func (r *v2Reporter) run() {
intervalTicker := time.Tick(r.interval)
pingTicker := time.Tick(time.Second * 5)
intervalTicker := time.NewTicker(r.interval)
pingTicker := time.NewTicker(time.Second * 5)

for {
select {
case <-intervalTicker:
case <-intervalTicker.C:
r.send()
case <-pingTicker:
case <-pingTicker.C:
_, err := r.client.Health(context.Background())
if err != nil {
log.Warn("Got error from influxdb client health check", "err", err.Error())
Expand Down

0 comments on commit 6c89882

Please sign in to comment.