diff --git a/src/main/java/org/folio/search/service/ResourceIdsJobService.java b/src/main/java/org/folio/search/service/ResourceIdsJobService.java index 63499619a..f0d0530a3 100644 --- a/src/main/java/org/folio/search/service/ResourceIdsJobService.java +++ b/src/main/java/org/folio/search/service/ResourceIdsJobService.java @@ -39,7 +39,12 @@ public ResourceIdsJob createStreamJob(ResourceIdsJob job, String tenantId) { log.info("Attempts to create streamJob by [resourceIdsJob: {}]", entity); log.info("[SLY] *** tenantId: {}", tenantId); - var savedJob = consortiumTenantExecutor.execute(() -> saveAndRun(entity, tenantId)); + boolean isNotShared = !tenantId.equalsIgnoreCase("consortium") + && entity.getQuery().contains("shared==\"false\""); + var savedJob = isNotShared + ? saveAndRun(entity, tenantId) + : consortiumTenantExecutor.execute(() -> saveAndRun(entity, tenantId)); + log.info("[SLY] *** SIMPLE: {}, savedJob: {}", isNotShared, savedJob.toString()); return resourceIdsJobMapper.convert(savedJob); }