Skip to content

Commit

Permalink
[logcli] set default instead of error for parallel-max-workers valida…
Browse files Browse the repository at this point in the history
…tion (grafana#8641)

**What this PR does / why we need it**:
Fixes regression reported here:
grafana#8518 (comment)

@dannykopping can you please verify that it fixes the issue for you?

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
  • Loading branch information
angaz authored Feb 27, 2023
1 parent 88120a0 commit 5c5b27d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/logcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,13 @@ func newQuery(instant bool, cmd *kingpin.CmdClause) *query.Query {

q.Start = mustParse(from, defaultStart)
q.End = mustParse(to, defaultEnd)
}
q.Quiet = *quiet

if q.ParallelMaxWorkers < 1 {
return fmt.Errorf("parallel-max-workers must be greater than 0")
if q.ParallelMaxWorkers < 1 {
log.Println("parallel-max-workers must be greater than 0, defaulting to 1.")
q.ParallelMaxWorkers = 1
}
}
q.Quiet = *quiet

return nil
})
Expand Down

0 comments on commit 5c5b27d

Please sign in to comment.