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 committed Jun 13, 2023
1 parent 36e72ea commit f47c069
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
}
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
}
Expand Down

0 comments on commit f47c069

Please sign in to comment.