Skip to content

Commit

Permalink
MSEARCH-794: enable async processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhiddin-yusuf committed Aug 19, 2024
1 parent 69aae17 commit 0aea7f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public CompletableFuture<Void> initFullReindex(String tenantId) {
.thenRun(this::publishRecordsRange)
.handle((unused, throwable) -> {
if (throwable != null) {
log.error("full reindex process failed: {}", throwable.getMessage());
statusService.updateMergeRangesFailed();
}
return unused;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import static org.folio.search.utils.TestUtils.randomId;
import static org.folio.search.utils.TestUtils.resourceEvent;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.springframework.http.MediaType.APPLICATION_JSON;
Expand All @@ -24,6 +23,7 @@
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import org.folio.search.domain.dto.CreateIndexRequest;
import org.folio.search.domain.dto.IndexDynamicSettings;
import org.folio.search.domain.dto.ReindexJob;
Expand Down Expand Up @@ -68,7 +68,7 @@ class IndexManagementControllerTest {

@Test
void runFullReindex_positive() throws Exception {
doNothing().when(reindexService).initFullReindex(TENANT_ID);
when(reindexService.initFullReindex(TENANT_ID)).thenReturn(new CompletableFuture<>());

mockMvc.perform(post(reindexFullPath()).header(XOkapiHeaders.TENANT, TENANT_ID))
.andExpect(status().isOk());
Expand Down

0 comments on commit 0aea7f6

Please sign in to comment.