diff --git a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java index 0181eb2..87d66e7 100644 --- a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java +++ b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java @@ -44,14 +44,15 @@ public void postAuditHandlersLogRecord(String entity, Map okapiH .exceptionally(throwable -> { LOGGER.warn("Error saving log event : {} due to : {}", entity, throwable.getLocalizedMessage()); return null; - }).thenAccept(v -> - asyncResultHandler.handle(succeededFuture(PostAuditHandlersLogRecordResponse.respond204())) - ); + }); } catch (Exception e) { LOGGER.warn("Error saving log event for entity {} due to {} ", entity, e.getMessage()); + } finally { asyncResultHandler.handle(succeededFuture(PostAuditHandlersLogRecordResponse.respond204())); } } + + private CompletableFuture> processAnonymize(List records, Map okapiHeaders, Context vertxContext) { LOGGER.debug("processAnonymize:: Processing anonymize for records"); diff --git a/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java b/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java index ce39fe8..70bc15d 100644 --- a/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java +++ b/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java @@ -95,7 +95,7 @@ void anonymizeLoanShouldRemoveUserDataFromRelatedRecords() { .log().all() .statusCode(204); - await().atLeast(1, TimeUnit.SECONDS); + await().pollDelay(1, TimeUnit.SECONDS).until(() -> true); given().headers(HEADERS).get(CIRCULATION_LOGS_ENDPOINT + "?query=(items=845687423)") .then().log().all().statusCode(200)