diff --git a/src/main/java/org/folio/search/service/ResourceIdsJobService.java b/src/main/java/org/folio/search/service/ResourceIdsJobService.java index f0d0530a3..42914e5fe 100644 --- a/src/main/java/org/folio/search/service/ResourceIdsJobService.java +++ b/src/main/java/org/folio/search/service/ResourceIdsJobService.java @@ -42,9 +42,9 @@ public ResourceIdsJob createStreamJob(ResourceIdsJob job, String tenantId) { boolean isNotShared = !tenantId.equalsIgnoreCase("consortium") && entity.getQuery().contains("shared==\"false\""); var savedJob = isNotShared - ? saveAndRun(entity, tenantId) + ? consortiumTenantExecutor.executeSimple(() -> saveAndRun(entity, tenantId), tenantId) : consortiumTenantExecutor.execute(() -> saveAndRun(entity, tenantId)); - log.info("[SLY] *** SIMPLE: {}, savedJob: {}", isNotShared, savedJob.toString()); + log.info("[SLY] *** SIMPLE EXECUTED: {}, savedJob: {}", isNotShared, savedJob.toString()); return resourceIdsJobMapper.convert(savedJob); } diff --git a/src/main/java/org/folio/search/service/consortium/ConsortiumTenantExecutor.java b/src/main/java/org/folio/search/service/consortium/ConsortiumTenantExecutor.java index 60493e4a3..bd2f4272e 100644 --- a/src/main/java/org/folio/search/service/consortium/ConsortiumTenantExecutor.java +++ b/src/main/java/org/folio/search/service/consortium/ConsortiumTenantExecutor.java @@ -31,6 +31,11 @@ public T execute(String originalTenantId, Supplier operation) { } } + public T executeSimple(Supplier operation, String tenantId) { + log.info("[SLY] *** No changing context {}", tenantId); + return operation.get(); + } + public void run(Runnable operation) { execute(() -> { operation.run();