Skip to content

Commit

Permalink
Merge pull request #58 from pagopa/chore-add-test-logs
Browse files Browse the repository at this point in the history
chore: add test logs
  • Loading branch information
pasqualespica authored Jan 17, 2024
2 parents 462418e + 48b48f9 commit 0288145
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,16 @@ public Iterable<FeedResponse<Receipt>> getIOErrorToNotifyReceiptDocuments(String
CosmosContainer cosmosContainer = cosmosDatabase.getContainer(containerId);

//Build query
String query = String.format("SELECT * FROM c WHERE c.status = '%s' AND c.generated_at >= %s OFFSET 0 LIMIT %s",
// String query = String.format("SELECT * FROM c WHERE c.status = '%s' AND c.generated_at >= %s OFFSET 0 LIMIT %s",
// ReceiptStatusType.IO_ERROR_TO_NOTIFY,
// OffsetDateTime.now().truncatedTo(ChronoUnit.DAYS).minusDays(
// Long.parseLong(numDaysRecoverNotNotified)).toInstant().toEpochMilli(),
// recordsLimitRecoverNotNotified
// );
String query = String.format("SELECT * FROM c WHERE c.status = '%s' AND c.generated_at >= %s",
ReceiptStatusType.IO_ERROR_TO_NOTIFY,
OffsetDateTime.now().truncatedTo(ChronoUnit.DAYS).minusDays(
Long.parseLong(numDaysRecoverNotNotified)).toInstant().toEpochMilli(),
recordsLimitRecoverNotNotified
Long.parseLong(numDaysRecoverNotNotified)).toInstant().toEpochMilli()
);

//Query the container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public static Receipt restoreReceipt(Receipt receipt) {
}

public static List<Receipt> receiptMassiveRestore(ReceiptStatusType statusType, ReceiptCosmosService receiptCosmosService) {


List<Receipt> receiptList = new ArrayList<>();
String continuationToken = null;
do {

Iterable<FeedResponse<Receipt>> feedResponseIterator =
receiptCosmosService.getNotNotifiedReceiptByStatus(continuationToken, 100, statusType);

Expand All @@ -37,8 +40,11 @@ public static List<Receipt> receiptMassiveRestore(ReceiptStatusType statusType,
receiptList.add(restoredReceipt);
}
continuationToken = page.getContinuationToken();

}
} while (continuationToken != null);


return receiptList;
}

Expand Down

0 comments on commit 0288145

Please sign in to comment.