Skip to content

Commit

Permalink
Use custom refresh policy in reactive repository with all clients.
Browse files Browse the repository at this point in the history
Original Pull Request #2350
Closes #2349
  • Loading branch information
sothawo committed Nov 3, 2022
1 parent 744b3ed commit 049bcf5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.client.erhlc.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.client.erhlc.ReactiveElasticsearchTemplate;
import org.springframework.data.elasticsearch.core.AbstractReactiveElasticsearchTemplate;
import org.springframework.data.elasticsearch.core.MultiGetItem;
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
import org.springframework.data.elasticsearch.core.ReactiveIndexOperations;
Expand Down Expand Up @@ -245,8 +245,8 @@ private String convertId(Object id) {
private Mono<Void> doRefresh() {
RefreshPolicy refreshPolicy = null;

if (operations instanceof ReactiveElasticsearchTemplate) {
refreshPolicy = ((ReactiveElasticsearchTemplate) operations).getRefreshPolicy();
if (operations instanceof AbstractReactiveElasticsearchTemplate template) {
refreshPolicy = template.getRefreshPolicy();
}

if (refreshPolicy == null) {
Expand Down

0 comments on commit 049bcf5

Please sign in to comment.