Skip to content

Commit

Permalink
✏️ Fix ide warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannig committed Nov 17, 2023
1 parent d2e65d1 commit 62dfbd0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
wg.Add(1)
metric := metric //https://golang.org/doc/faq#closures_and_goroutines

Check failure on line 278 in collector/collector.go

View workflow job for this annotation

GitHub Actions / build

File is not `gofumpt`-ed with `-extra` (gofumpt)

go func() {
f := func() {
defer wg.Done()

level.Debug(e.logger).Log("About to scrape metric: ")
Expand Down Expand Up @@ -317,7 +317,8 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
} else {
level.Debug(e.logger).Log("Successfully scraped metric: ", metric.Context, metric.MetricsDesc, time.Since(scrapeStart))
}
}()
}
go f()
}
wg.Wait()
}
Expand Down Expand Up @@ -516,8 +517,8 @@ func (e *Exporter) generatePrometheusMetrics(db *sql.DB, parse func(row map[stri
defer cancel()
rows, err := db.QueryContext(ctx, query)

if ctx.Err() == context.DeadlineExceeded {
return errors.New("Oracle query timed out")
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
return errors.New("oracle query timed out")
}

if err != nil {
Expand Down

0 comments on commit 62dfbd0

Please sign in to comment.