From 8e9b6224ddb82f011cbe5a7fea727e75d6d01ae5 Mon Sep 17 00:00:00 2001 From: "siddarth.msv" Date: Tue, 13 Jun 2023 21:18:16 +0530 Subject: [PATCH] fixup! chore: avoid querying a dataset in case AfterJobID falls after said dataset --- jobsdb/jobsdb.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jobsdb/jobsdb.go b/jobsdb/jobsdb.go index f3442c3a3f..7e4a7674dd 100644 --- a/jobsdb/jobsdb.go +++ b/jobsdb/jobsdb.go @@ -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 } @@ -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 }