Skip to content

Commit

Permalink
Merge pull request #1516 from akto-api-security/hotfix/backfill_cron
Browse files Browse the repository at this point in the history
fixed skip for mongo query
  • Loading branch information
avneesh-akto authored Sep 19, 2024
2 parents 1167d4c + b97647e commit e47cbf3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ private static void backFillDiscovered() {
)
);
}
ApiInfoDao.instance.getMCollection().bulkWrite(updates);
if (!updates.isEmpty()) ApiInfoDao.instance.getMCollection().bulkWrite(updates);

} while (!singleTypeInfos.isEmpty());

Expand All @@ -2383,6 +2383,7 @@ private static void backFillStatusCodeType() {
int skip = 0;
do {
sampleDataList = SampleDataDao.instance.findAll(Filters.empty(), skip, 100, sort);
skip += sampleDataList.size();
List<ApiInfo> apiInfoList = new ArrayList<>();
for (SampleData sampleData: sampleDataList) {
Key id = sampleData.getId();
Expand Down Expand Up @@ -2425,7 +2426,7 @@ private static void backFillStatusCodeType() {
)
);
}
ApiInfoDao.instance.getMCollection().bulkWrite(updates);
if (!updates.isEmpty()) ApiInfoDao.instance.getMCollection().bulkWrite(updates);

} while (!sampleDataList.isEmpty());

Expand Down

0 comments on commit e47cbf3

Please sign in to comment.