Skip to content

Commit

Permalink
CIRC-2100 Adding loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh-kalyanasundaram committed Jul 30, 2024
1 parent fe2a97d commit e3644c8
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ public CompletableFuture<Result<MultipleRecords<Request>>> findPrintEventDetails
log.debug("findPrintEventDetails:: parameters multipleRequests: {}",
() -> multipleRecordsAsString(multipleRequests));
return validatePrintEventFeatureFlag()
.thenCompose(isEnabled -> Boolean.TRUE.equals(isEnabled) ?
fetchAndMapPrintEventDetails(multipleRequests)
: completedFuture(succeeded(multipleRequests)));
.thenCompose(isEnabled -> {
if (Boolean.TRUE.equals(isEnabled)) {
log.info("findPrintEventDetails:: printEvent feature is enabled for the tenant");
return fetchAndMapPrintEventDetails(multipleRequests);
} else {
log.info("findPrintEventDetails:: printEvent feature is disabled for the tenant");
return completedFuture(succeeded(multipleRequests));
}
});
}

private CompletableFuture<Result<MultipleRecords<Request>>> fetchAndMapPrintEventDetails(
Expand All @@ -64,6 +70,7 @@ private CompletableFuture<Result<MultipleRecords<Request>>> fetchAndMapPrintEven
() -> multipleRecordsAsString(multipleRequests));
var requestIds = multipleRequests.toKeys(Request::getId);
if (requestIds.isEmpty()) {
log.info("fetchAndMapPrintEventDetails:: No request id found");
return completedFuture(succeeded(multipleRequests));
}
return fetchPrintDetailsByRequestIds(requestIds)
Expand Down

0 comments on commit e3644c8

Please sign in to comment.