File tree 1 file changed +6
-3
lines changed
topic/src/main/java/tech/ydb/topic/write/impl
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -269,16 +269,19 @@ protected CompletableFuture<CompletableFuture<WriteAck>> sendImpl(Message messag
269
269
return tryToEnqueue (enqueuedMessage , instant ).thenApply (v -> enqueuedMessage .getFuture ());
270
270
}
271
271
272
+ /**
273
+ * Create a wrapper upon the future for the flush method.
274
+ *
275
+ * @return an empty Future if successful. Throw CompletionException when an error occurs.
276
+ */
272
277
protected CompletableFuture <Void > flushImpl () {
273
278
if (this .lastAcceptedMessageFuture == null ) {
274
279
return CompletableFuture .completedFuture (null );
275
280
}
276
281
incomingQueueLock .lock ();
277
282
278
283
try {
279
- return this .lastAcceptedMessageFuture .isDone ()
280
- ? CompletableFuture .completedFuture (null )
281
- : this .lastAcceptedMessageFuture .thenApply (v -> null );
284
+ return this .lastAcceptedMessageFuture .thenApply (v -> null );
282
285
} finally {
283
286
incomingQueueLock .unlock ();
284
287
}
You can’t perform that action at this time.
0 commit comments