Skip to content

Commit

Permalink
[ingestion-2023] hidden true
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Dec 11, 2024
1 parent edcc248 commit e71d3b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public CompletableFuture<Void> computeTranche(
log.info(
"PMIngestion Start analyzing one day with {} records [Day {}] [part. {}]",
count,
dateFrom,
dateFrom.toLocalDate(),
tranche);

List<LocalDateTime> fractions = generateDateSlices(dateFrom, dateTo, slicesNumber);
Expand Down Expand Up @@ -150,14 +150,14 @@ public CompletableFuture<Void> computeTranche(
.map(BizEventsPMIngestionExecution::getNumRecordFound)
.reduce(Integer::sum)
.orElse(-1),
dateFrom,
dateFrom.toLocalDate(),
tranche);
})
.thenRun(executor::shutdown)
.exceptionally(
(ex) -> {
executor.shutdown();
log.error("Error PMIngestion with {} records [Day {}] [part. {}]", count, dateFrom, tranche, ex);
log.error("Error PMIngestion with {} records [Day {}] [part. {}]", count, dateFrom.toLocalDate(), tranche, ex);
return null;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private BizEventsViewUser buildUserView(PMEvent pmEvent, PMEventPaymentDetail pm
.transactionId("PM-" + pmEventPaymentDetail.getPkPaymentDetailId().toString() + "-" + ldt.getYear())
.taxCode(userDetail.getTaxCode())
.transactionDate(pmEvent.getCreationDate())
.hidden(isHidden)
.hidden(true)
.isPayer(isPayer)
.isDebtor(isDebtor)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public SliceService(

@Transactional
@ExponentialBackoffRetry(
maxRetryCount = 3,
maximumInterval = "00:03:00",
minimumInterval = "00:00:05")
maxRetryCount = 3,
maximumInterval = "00:03:00",
minimumInterval = "00:00:05")
public BizEventsPMIngestionExecution computeSlice(
Specification<PPTransaction> spec,
BizEventsPMIngestionExecution pmIngestionExec,
Expand Down Expand Up @@ -183,11 +183,11 @@ private void handleEventList(
maximumInterval = "00:00:30",
minimumInterval = "00:00:05")
private <T> void bulkSave(List<T> generals, CosmosRepository<T, String> repository) {
int bulkSize = 500;
for (int i = 0; i < generals.size(); i += bulkSize) {
int endIndex = Math.min(i + bulkSize, generals.size());
List<T> bulk = generals.subList(i, endIndex);
repository.saveAll(bulk);
}
int bulkSize = 500;
for (int i = 0; i < generals.size(); i += bulkSize) {
int endIndex = Math.min(i + bulkSize, generals.size());
List<T> bulk = generals.subList(i, endIndex);
repository.saveAll(bulk);
}
}
}

0 comments on commit e71d3b7

Please sign in to comment.