Skip to content

Commit

Permalink
Return err without any checks as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswine committed Jun 16, 2022
1 parent 1becc2f commit 7b44c17
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,18 @@ func (q *SingleTenantQuerier) Label(ctx context.Context, req *logproto.LabelRequ
var storeValues []string
if !q.cfg.QueryIngesterOnly && storeQueryInterval != nil {
g.Go(func() error {
var err error
from := model.TimeFromUnixNano(storeQueryInterval.start.UnixNano())
through := model.TimeFromUnixNano(storeQueryInterval.end.UnixNano())
var (
err error
from = model.TimeFromUnixNano(storeQueryInterval.start.UnixNano())
through = model.TimeFromUnixNano(storeQueryInterval.end.UnixNano())
)

if req.Values {
storeValues, err = q.store.LabelValuesForMetricName(ctx, userID, from, through, "logs", req.Name)
if err != nil {
return err
}
} else {
storeValues, err = q.store.LabelNamesForMetricName(ctx, userID, from, through, "logs")
if err != nil {
return err
}
}

return nil
return err
})
}

Expand Down

0 comments on commit 7b44c17

Please sign in to comment.