Skip to content

Commit

Permalink
ISPN-7068 Fix the MassIndexer with Elasticsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavonalle committed Jan 20, 2017
1 parent 36e817f commit 9630ca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Expand Up @@ -50,6 +50,10 @@ public void purge(Class<?> entityType) {
defaultBatchBackend.purge(Collections.singleton(entityType));
}

public void waitForAsyncCompletion() {
defaultBatchBackend.awaitAsyncProcessingCompletion();
}

public void updateIndex(Object key, Object value) {
if (value != null) {
if (!Thread.currentThread().isInterrupted()) {
Expand Down
Expand Up @@ -62,6 +62,7 @@ protected void preIndex() {
}

protected void postIndex() {
indexUpdater.waitForAsyncCompletion();
if (flush) indexUpdater.flush(entity);
}

Expand Down

0 comments on commit 9630ca1

Please sign in to comment.