Skip to content
Prev Previous commit
More idiomatic change of empty mono type
  • Loading branch information
rozza committed Jul 29, 2024
commit cc75540820f3453e6491f1e009ace3b470184446
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@
import org.reactivestreams.Subscriber;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import reactor.util.context.ContextView;

import java.nio.ByteBuffer;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;

import static com.mongodb.ReadPreference.primary;
import static com.mongodb.assertions.Assertions.notNull;
Expand Down Expand Up @@ -155,7 +152,7 @@ private Mono<Void> createCheckAndCreateIndexesMono(@Nullable final Timeout timeo
.switchIfEmpty(Mono.defer(() ->
checkAndCreateIndex(filesCollection.withReadPreference(primary()), FILES_INDEX, timeout)
.then(checkAndCreateIndex(chunksCollection.withReadPreference(primary()), CHUNKS_INDEX, timeout))
.then(Mono.fromCallable(Document::new))
.then(Mono.empty())
))
.then();
}
Expand Down