Fix timeout subscription

This commit is contained in:
Andrea Cavalli 2021-09-09 11:43:37 +02:00
parent 48db79359b
commit cb5a5e36f2

View File

@ -72,8 +72,8 @@ public class CachedIndexSearcherManager {
logger.error("Failed to refresh the searcher manager", ex);
}
})
.repeatWhen(s -> s.delayElements(queryRefreshDebounceTime, Schedulers.boundedElastic()))
.subscribeOn(Schedulers.boundedElastic())
.repeatWhen(s -> s.delayElements(queryRefreshDebounceTime))
.takeUntilOther(closeRequested.asMono())
.doAfterTerminate(refresherClosed::tryEmitEmpty)
.subscribe();
@ -158,7 +158,7 @@ public class CachedIndexSearcherManager {
.cacheInvalidateWhen(indexSearcher -> Mono
.firstWithSignal(
this.closeRequested.asMono(),
Mono.delay(queryRefreshDebounceTime, Schedulers.boundedElastic()).then()
Mono.delay(queryRefreshDebounceTime).then()
),
indexSearcher -> {
try {