Skip to content

Commit

Permalink
fixup! chore: avoid querying a dataset in case AfterJobID falls after…
Browse files Browse the repository at this point in the history
… said dataset
  • Loading branch information
Sidddddarth authored and atzoum committed Jun 14, 2023
1 parent 27df004 commit 8e9b622
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jobsdb/jobsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3127,7 +3127,8 @@ func (jd *HandleT) getUnprocessed(ctx context.Context, params GetQueryParamsT) (
}
for idx, ds := range dsList {
if params.AfterJobID != nil {
if idx < len(dsRangeList) {
if idx < len(dsRangeList) { // ranges are not stored for the last ds
// so the following condition cannot be applied the last ds
if *params.AfterJobID > dsRangeList[idx].maxJobID {
continue

Check warning on line 3133 in jobsdb/jobsdb.go

View check run for this annotation

Codecov / codecov/patch

jobsdb/jobsdb.go#L3131-L3133

Added lines #L3131 - L3133 were not covered by tests
}
Expand Down Expand Up @@ -3256,7 +3257,8 @@ func (jd *HandleT) GetProcessed(ctx context.Context, params GetQueryParamsT) (Jo
}
for idx, ds := range dsList {
if params.AfterJobID != nil {
if idx < len(dsRangeList) {
if idx < len(dsRangeList) { // ranges are not stored for the last ds
// so the following condition cannot be applied the last ds
if *params.AfterJobID > dsRangeList[idx].maxJobID {
continue

Check warning on line 3263 in jobsdb/jobsdb.go

View check run for this annotation

Codecov / codecov/patch

jobsdb/jobsdb.go#L3261-L3263

Added lines #L3261 - L3263 were not covered by tests
}
Expand Down

0 comments on commit 8e9b622

Please sign in to comment.