tabish121 commented on code in PR #4349:
URL: https://github.com/apache/activemq-artemis/pull/4349#discussion_r1090906925
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java:
##########
@@ -179,11 +182,13 @@ public void close(PageSubscription cursor) {
}
@Override
- public void scheduleCleanup() {
+ public Future<Boolean> scheduleCleanup() {
+ final SimpleFutureImpl<Boolean> future = new SimpleFutureImpl<>();
if (!cleanupEnabled || scheduledCleanup.intValue() > 2) {
// Scheduled cleanup was already scheduled before.. never mind!
// or we have cleanup disabled
- return;
+ pagingStore.execute(() -> future.set(true));
Review Comment:
Is there a reason why you need to fire off a task into the executor just to
return a completed future? Seems simpler to just return
CompletableFuture.completedFuture or just complete this one and return it
directly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]